You can use focus for that.
I do this:

1) When swapping the main character I set focus to him (this is done on all characters!).
2) Now all characters have a focus set to the main and the main Window is in active.
3) On the main client, now do a clearfocus command, which removes the focus from this client only, because this button is not broadcasted (separate button)

All casts that can only be casted on the slaves should have macros like this:
/stopmacro [target=focus,noexists]
<rest of macro>