MZ a call to check available battle commands [Solved]

Ive been looking through script calls and cannot find this so I am asking here. Im trying to create and if/else statement based on the amount of battle commands an actor has (if greater than 4 X else X) but cannot find the script for commands. Can anyone help me find this?
This appears to be a duplicate question for your thread earlier this afternoon about actor command window adjustments. That never makes sense, as you may get various people responding to one thread not aware of what you've already gotten from the other.

Did you Google it? There are existing plugins to do this. Even if it doesn't work natively in MZ, you should be able to find the related portion of the code.
I've seen that one and it does exactly what I have already done. Expanding rows isn't my issue. I'm trying to have it expand to two rows if the player has more than 4 commands. Which is why I was looking for a way to count an actors battle commands to expand it.
Answering here instead of your other thread since there's already activity here.

This will do what I believe you want, based on what I've picked up from your threads. Not thoroughly tested.

JavaScript:
(() => {
  
    const breakpoint = 4;
    const Window = Window_ActorCommand.prototype;

    const init = Window.initialize;
    Window.initialize = function(rect) {
        this._columns = 1;
        init.call(this, rect);
    }
    const makeCommandList = Window.makeCommandList;
    Window.makeCommandList = function() {
        makeCommandList.apply(this);
        if (!this._actor) return;
        (this._list.length > breakpoint) ? this._columns = 2 : this._columns = 1;
    }
    Window.maxCols = function() {
        return this._columns;
    }
  
})();
@Kenen thanks this works perfectly for expanding to two columns when greater than 4. Was it supposed to use column 1 first or was this just an auto expand?
I don’t understand your question.
Oh I was also looking for a way to force the commands to use column 1 before column two and didn't know if that was in there or not because it wasnt doing that. If not that's cool I was just curious.
You're saying you don't want someone to be able to move the cursor to the right or left to be able to jump between columns?

Or are you saying you want the commands to be drawn down the first column before using the second?

The code above doesn't make any modifications to the item drawing or selection process; it only changes the maxRows() function to refer to a variable instead of a static number.
Drawn down the first before the second.

No worries this was a huge help and a big step in the right direction for me.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/a-call-to-check-available-battle-commands-solved.154990/