Not from personal experience[/disclaimer]
When in a firefight you generally are putting more rounds towards BG than you think (i.e, you aren't counting).
If there is a 'pause' and you have cover, put in a fresh mag, because the next time you end up in line of fire, you don't want to get 2 rounds out and find yourself fumbling for a mag while jumping towards cover.
If you are CERTAIN you only fired 2-5 rounds out of 30, then you can probably skip it, but if you have fired over 10, you probably fired closer to 20. This is just something I was told while practicing with people who have dealt with it, I am sure others can be more clear on the logic.
In handguns: more than 3 rounds, change if you can, in a defense scenario (Thinking 1 person that walked into wrong alley and met up with 5 people wanting to kill him). It probably won't be a "force on force" thing with CCW people, and how many people that carry also continually conceal carry 5+ spare mags in the event they stumble into a war?
"Counting rounds" doesn't work. Under extreme stress, people have forgotten to release the safety, do you think they were counting rounds when they did start firing? Several places I have READ state people typically shoot twice as many rounds as they thought they did in the aftermath of a firefight.