It would be a thousand times easier to just have one command returning all magazines that are in the inventory of a unit or box.
Just one command which has additional info in the array, like for example:
[
["AmmoClassName", 26 /*ammo count*/, true /*currently loaded*/, 0 /* 0 = primary mag, 1 = secondary, 2 = handgun*/, "vest" /*stored in ...*/]
]
This would make it much easier to readd those magazines again after a MP respawn for example with addMagazinesExt or whatever it would be called.