Understanding global key commands

I’m new to this, and I’m attempting to wrap my head around global key commands. I have two sides–side A, and side B. Their units may be marked with a demoralized piece, which can be in two steps (as layers on the piece).

I’d like to create a button that allows player A (at the end of his turn) to click and reset the demoralized status. Anything that is on level 2 of the demoralized marker should go to level 1, and anything already on level 1 should be removed. It appears that this should be relatively straightforward, but the documentation isn’t entirely clear on the best way to do this.

Does anyone have an example module that does something similar? Or any steps on how to implement this? Thanks.

One suggestion is to use a Dynamic Property that allows you to track your different states (e.g. rallied vs demoralized) as a numeric counter. If you set it’s Property Name to the same name as your Layer, and if your layer levels correspond to the numeric values in your Dynamic Property, you should be able to trigger the different behavior you want. Your Action Button can then kick off the key commands necessary to trigger your different states by incrementing or decrementing your Dynamic Property.

Check out Combat Commander: Europe for some tips on how to do stuff like this. That’s where I got my ideas for this type of functionality from.