If anybody happens upon this thread when searching Google, I'll be a nice guy and give you my answer, assuming you want every unit to have an unlimited amount of smoke grenades and chemlights. Here's what I'd do:
replenish = {
_unit = _this select 0;
_weapon = _this select 3;
_magazine = _this select 5;
if (toString _weapon == "Throw") then {
_chemlight = toArray _magazine;
_chemlight resize 9;
_smoke = toArray _magazine;
_smoke resize 10;
if (toString _chemlight == "Chemlight" or {toString _smoke == "SmokeShell"}) then { _unit addMagazine _magazine; }
};
};
{_x addEventHandler ["Fire", {_this spawn replenish}} forEach allUnits;
Something like that? Should work, haven't tested it though. You should probably privatize the variables too. Also, it might not be a good idea to run this entire thing everytime someone fires. I don't know.