I tried this once (
here) but I didn't care much about proceeding with this addon.
Anyway, it's very simple:
Create an addon for an invisible unit (create a model in O2 with the name of the selections of a regural unit, but remove any points from LOD's, geometry settings, hit-points, etc.). Then configure this to be dead on init (EH "init" --> init="(_this select 0) setDammage 1"), to carry no weapons (remove 1,16, 32 and 4096 from the available weapon slots) and carry the highest amount of mags (4xHandGun and 10xMiscMags).
Once you've configured this unit, make a script that will place this unit next to another one (constantly). Ensure that the invisible unit has the required magazines. And that's it.
No further scripting is required, since the alive units will automatically take the ammo from the nearest deadbodies. Be sure that your ammo bearer is always near, as the AI doesn't catch ammo from deadbodies that distance more than 50m. You can also add a script to refresh the ammount of magazines available in the invisible unit.