MV Help Forcing Battle Phases

Hi!
I've been picking through MV's battle system trying to make a somewhat new battle system, where the player can take as many actions as they want during an "input" phase and then press a "commit" button to move to turn/action phases.

I've written the following (basic) code to watch for the "M" key being pressed during the input phase, and when "M" is pressed, trying to force startTurn to begin the turn, taking whatever actions are stored and run them.

Code:
    if(Input.keyMapper)
    {
        Input.keyMapper[77] = `commit`; //m
    }

Code:
    const originalScene_Battle_prototype_update = Scene_Battle.prototype.update;
    Scene_Battle.prototype.update = function()
    {
        if(Input.isTriggered(`commit`) && BattleManager._phase == 'input')
        {
            console.log(`m pressed`);
            commitActions();
        }
    originalScene_Battle_prototype_update.call(this);
    };

    function commitActions()
    {

            BattleManager.startTurn();
    }

Some issues arise running this.
When "M" is pressed and startTurn is forced, the commandWindows (party or actor) remain on screen, and the status slides over (img attached.) After you press "ok" or "cancel," the window closes and the turn phase begins (action are taken.)

I've been digging around through the battle system files, and have figured out some things, but I'd like help understanding how phases transition to each other (and how windows control/are controlled) so I can press "M" and proceed cleanly to the turn phase.

EDIT:
I've done tests dealing just with the window, disactivate(), close(), etc and have figured out that getting rid of the window alone does not remove the roadblock to running startTurn. Darn!!!!
After posting this, I tried _partyCommandWindow.close(), which did work to close the window, but still doesn't allow me to continue processing the battle (pressing m to move to _phase = turn gets stuck, even without a command window.)
So it must be something with BattleManager, and forcing the move between phases...

Original thread: https://forums.rpgmakerweb.com/threads/help-forcing-battle-phases.181102/