MV How I return the Rows number for Window_ActorCommand as the number of commands the actor have?

I tried to use this code:

JavaScript:
Window_ActorCommand.prototype.maxItems = function() {
    return this._actor ? this._actor.skill().length : 0;
};

Window_ActorCommand.prototype.numVisibleRows = function() {
    return this.maxItems();
};
But, this gave me a error. I don't know how I return the number of commands of the actor have.
Which command returns the number of Commands an Actor has?

Original thread: https://forums.rpgmakerweb.com/threads/how-i-return-the-rows-number-for-window_actorcommand-as-the-number-of-commands-the-actor-have.127890/