Use the onFire function to bump up a variable by one.
Basic onFire:
function WeaponImage::onFire(%this, %obj, %slot){}
%this is the datablock of the weapon calling the function
%obj is the player shooting the weapon
%slot is the slot in the inventory I think.
Make sure to change WeaponImage to your weapon's image otherwise it will effect all weapons, including hammer, wrench, printer etc.
Also, I'm not sure whether you have to parent and package it.