Just as Ives said, for another tool I did this, where the value the switch acts on is the animation of the weapon...
I don't remember if my addon reads the animation, I could look into that (although I have as backlog of things to look at in my addons)
switch...