Hi Erik,
Oddly, Toolbar GKCs in 3.1 can only affect counters in the same window - you’re not doing it wrong, it just doesn’t work. Fortunately, there’s an easy workaround - pieces can execute GKCs on other maps, so have your toolbar button delegate the GKC to an invisible piece on the player window. I describe this in more detail in this thread:
https://forum.vassalengine.org/t/global-key-command-in-player-hand/4622/1
Peace,
Seth