Display actions left in battle?!

Hey,
So you know how an actor (or enemy) in standard MV battle system can have % more actions.
Like let's say my character has 2 x 100%+ actions, which means the actor is on 3 actions in total.

Can I somehow display how many actions my character has left? A little extra window or addition to default hud would do.
I made a plugin that can do this. I didn't add any plugin parameters, however if there is something you would like to be able to change through these parameters let me know and I will add it.

Currently it shows a small window with the text "Actions left: X".

If you have any questions or requests for changes feel free to ask. 🙂

Code:
//=============================================================================
// ActionAmount.js
//=============================================================================

/*:
 * @plugindesc This plugin adds a window that shows how many actions an actor
 * has left on his/her turn.
 * @author Magnus0808
 *
 * @help Plug and play
 */
(function() {
    
    
    //-----------------------------------------------------------------------------
    // Window_Action
    //
    // The window for displaying the current actors actions left
    
    function Window_Action() {
        this.initialize.apply(this, arguments);
    }
    Window_Action.prototype = Object.create(Window_Base.prototype);
    Window_Action.prototype.constructor = Window_Action;
    
    Window_Action.prototype.initialize = function(x, y) {
        var width = this.windowWidth();
        var height = this.windowHeight();
        Window_Base.prototype.initialize.call(this, x, y, width, height);
        this.refresh();
    };
    
    Window_Action.prototype.windowWidth = function() {
        return 240;
    };

    Window_Action.prototype.windowHeight = function() {
        return this.fittingHeight(1);
    };
    
    Window_Action.prototype.refresh = function() {
        var x = this.textPadding();
        var width = this.contents.width - this.textPadding() * 2;
        this.contents.clear();
        this.drawActionValue(this.value(), x, 0, width);
    };
    
    Window_Action.prototype.value = function() {
        if (this.actor) {
            this.show();
            console.log(this.actor);
            if(this.actor._actCostInputs) { // Added compatibility to DoubleX RMMV Action Cost
                return this.actor.numActions() - (this.actor._actionInputIndex + this.actor._actCostInputs);
            } else {
                return this.actor.numActions() - this.actor._actionInputIndex;
            }
        } else {
            this.hide();
            return 0;
        }
    }
    
    Window_Action.prototype.setActor = function(actor) {
        this.actor = actor;
        this.refresh();
    }
    
    Window_Action.prototype.drawActionValue = function(value, x, y, width) {
        this.drawText("Actions left: " + value, x, y, width, 'left');
    }
    
    Window_Action.prototype.open = function() {
        this.refresh();
        Window_Base.prototype.open.call(this);
    };
    
    
    //-----------------------------------------------------------------------------
    // Scene_Battle
    //
    // Added the Windoe_Action to the scene.
    
    Scene_Battle.prototype.createAllWindows = function() {
        this.createLogWindow();
        this.createStatusWindow();
        this.createPartyCommandWindow();
        this.createActorCommandWindow();
        this.createHelpWindow();
        this.createSkillWindow();
        this.createItemWindow();
        this.createActorWindow();
        this.createEnemyWindow();
        this.createMessageWindow();
        this.createScrollTextWindow();
        this.createActionWindow();
    };
    
    Scene_Battle.prototype.createActionWindow = function() {
        this._actionWindow = new Window_Action(0, 0);
        this._actionWindow.y = this._actorWindow.y - this._actionWindow.height;
        this.addWindow(this._actionWindow);
    }
    
    Scene_Battle.prototype.selectPreviousCommand = function() {
        BattleManager.selectPreviousCommand();
        this._actionWindow.setActor(BattleManager.actor());
        this.changeInputWindow();
    };
    
    Scene_Battle.prototype.selectNextCommand = function() {
        BattleManager.selectNextCommand();
        this._actionWindow.setActor(BattleManager.actor());
        this.changeInputWindow();
    };
        

})();
Okay - so this is kind of emberassing and pretty much a noob mistake from me, I maybe should have mentioned I intended to use this feature together with another plugin.
First of all, thank you so much for taking the time and making this for me.

I was thinking I could maybe turn my combat in some sort of action-point system, using a plugin to display the actions left together with
https://forums.rpgmakerweb.com/index.php?threads/doublex-rmmv-action-cost.60556/#post-650318

This plugin, that makes it so that actions can cost more than 1 point per turn. So my theory was, that there wouldn't be any compatibility issues.
Well technically there aren't any, but I made an example project to test it out, and it doesn't decrease the number of actions by the number of actions the skill cost. So for example, Harold's Heal Magic cost 2 actions, and if I select it, it will display (3 actions left) (harold had 4 actions in the beginning), and then I use it again and it will start the turn, using Heal Magic 2 times, even tho it displayed 3 actions left last time I checked.

... is it a far stretch to combat this compatibility problem? 🙁
If not it's fine, and thanks still a lot!
I added compatibility with DoubleX RMMV Action Cost to the plugin. Turned out it added a _actCostInputs value to the actor to keep track of how many "extra" actions he/she had taken. 🙂

I have edited my original reply with the changes.

Original thread: https://forums.rpgmakerweb.com/threads/display-actions-left-in-battle.105405/