I do not recall having spasms in my legs but if I did a bunch of crunches my stomach would be experience something like you described. Are you taking calcium and magnesium? I think this would help with this sort of thing. Maybe you are coughing so much and sweating that you are losing excessive amounts of electrolytes? Just guessing.