Multiple ActorCommand windows on SceneBattle

I am trying to have two separate command windows in a battle scene, both to isolate less-commonly used commands in a separate window, and to make the main command window smaller and less intrusive. The player would use left-right buttons to switch between them and choose a command.

To this end, I have added a custom Window_ActorSecondaryCommand class, which is largely similar to the regular Window_ActorCommand, and defined processHandling methods for them both, in which they deactivate() themselves, and activate() their twin window on 'left' and 'right' inputs.

When testing, I discovered that using the 'right' command activates the secondary window just like it should, but the main command window either does not get deactivated, or more likely, gets re-activated right away. This leads to both windows being active together, and processHandling for the secondary window(to track 'left' inputs) remaining uncalled and non-functional.

I assume it has something to do with the update/refresh-type of methods resetting the window activation, but I couldn't really find anything that'd re-activate the Window_ActorCommand. Could anyone point me in the right direction?

Attached the .js file with my function for everybody's convenience.

Original thread: https://forums.rpgmakerweb.com/threads/multiple-actorcommand-windows-on-scenebattle.120135/