Look at the stateTransitionOn(some words)[(some number)] = "(some state name)"; lines.
Guns that fire once per shot us a stateTransitionOnTriggerUp, while you could change it to ...OnTimeout to have it automatically fire again, although you might need more than that...
It's a good idea to try to understand how the states work, because you can do some really awesome things with them.