It depends on the weapon, you need to write the code into the gun data itself so that it is capable of changing these values, otherwise it's impossible.
So it won't work on weapons like the default gun, it will work on weapons that are designed to have these values changed by events.