That’s great, I’m glad we’ve finally found a solution!
(ZScript can be infuriating but curiously addictive. I look forward to more from you here in due course… )
Note: you don’t really need the mainSubTool variable or the SubToolSelect as with your code the selected subtool doesn’t need to change.