I usually place my musketeers on higher ground and have the fighting happen on lower ground. This will solve the problem.

If it is flat ground... then i have to move my musketeers to the flanks when the infantry clashes.