MZ Battle menu: Press right --> to access Guard command

Hi everyone. I could not find any plugins or suggestions having to do with the Guard move (besides removing it from the battle menu). I have very limited javascript knowledge, so any advice or assistance is much appreciated.

I want to move Guard/Defend off the visible menu, and have it be accessible by pressing right, the way SNES Final Fantasy handles the choice.

From the fandom description of the ability:
"Defend (Def. in the older translation) is also a regular command everybody can access by pressing the cursor to the right while in battle."

In the following example, the player starts out with the basic battle menu, but can press right to access Defend, which is obfuscated for a cleaner UI.

Final Fantasy III (U) (V1.0) [!].001.png
Final Fantasy III (U) (V1.0) [!].002.png


I have made the following change to line 5989 rmmz_windows.js:

JavaScript:
Window_ActorCommand.prototype.makeCommandList = function() {
    if (this._actor) {
        this.addAttackCommand();
        this.addSkillCommands();
        this.addItemCommand();
        this.addGuardCommand();
    }
};

Putting addGuardCommand at the end of the list at least pushes Guard to the bottom of my five-item list. This effectively pushes it off the screen and preserves my four-item goal, but I would love to reproduce the elegance of hiding it off to the right, with no extraneous arrows busying up the screen, pointing down, and distracting the eye as they are wont to do.
As an overview, this involves:
- creating a new window type for the command to go into
- the associated methods to print the command and to process Ok and Cancel
- and a new version for Window_ActorCommand processHandling() or processCursorMove() to make it open that new window when you press right.

I know that's not giving you the code, but it's a starting point for anyone else looking at this.

If no one's come up with anything for it by tonight, I might take a crack - it's a request I've seen a few times.
Yes, thank you! After posting this I did look for something like a "page 2" plugin or additional battle menu windows plugin, and although you've broken it down to the bare essentials, there could be some deeper reason for there being nothing else like that already in existence.

Because it's not an original idea, literally borrowing an idea from the genre upon which RPG Maker is based. That makes me think it could be very difficult or else someone would have done this already.

I'm proud of myself for finding the code where to switch my battle menu commands around, because I don't know js at all. I just knew the pattern to look for! I ctrl+f guard, found it in the count, cut and paste.

Original thread: https://forums.rpgmakerweb.com/threads/battle-menu-press-right-to-access-guard-command.160728/