Armor::onTrigger(%this, %obj, %triggerNum, %val) is the function these weapons are using to extend right click's functionality. It's called for several different things like left clicking, right clicking, jumping, crouching, some others I'm probably forgetting, or releasing any of those buttons as well
%this is the player datablock
%obj is the player object
%triggerNum is the type of trigger (right click is 4 so you'll want to make sure %triggerNum == 4)
%val returns true if trigger is being pressed, false if being released
Example (not tested):
function Armor::onTrigger(%data, %player, %triggerNum, %val)
{
Parent::onTrigger(%data, %player, %triggerNum, %val);
if(%triggerNum == 4 && %val && %player.getMountedImage(0) == nameToID("YourWeaponImage"))
{
// do stuff
}
}