MV Battle plugin. Combining attacks with timing function

Hi All,

Looking for a bit of help here!!

This is my first attempt making a plugin of any kind. I'm attempting to create a function in my battle system that runs on a combo gauge and real time response. The idea is inspired by Vivi/Steiner swrd magic combination from FFIX. Basically when the gauge is full a combo option pops up. Depending on the abilities selected and the order they're selected in you can retrieve different results, this includes failures if you're experimenting. You can think of it as perhaps an open crafting system where you can combine ingredients trying to get different/better results, except in battle with battle skills. Here's my, probably aweful, attempt at this plugin. I can't even get the gauge to appear haha.

Spoiler: Plugin Codes
JavaScript:
//=============================================================================
// MyComboGauge.js
//=============================================================================

/*:
 * @plugindesc Adds a combo gauge for the MyComboAttacks plugin.
 * @author Nhobson
 *
 * @param Gauge Image
 * @desc The filename of the image to use for the gauge.
 * @default ComboGauge
 * @require 1
 * @dir img/pictures/
 * @type file
 *
 * @param Gauge Width
 * @desc The width of the gauge in pixels.
 * @default 200
 * @type number
 *
 * @param Gauge Height
 * @desc The height of the gauge in pixels.
 * @default 20
 * @type number
 *
 * @param X Position
 * @desc The X position of the gauge on the screen.
 * @default 10
 * @type number
 *
 * @param Y Position
 * @desc The Y position of the gauge on the screen.
 * @default 10
 * @type number
 *
 * @help
 * This plugin adds a combo gauge for the MyComboAttacks plugin.
 */

(function() {

    var parameters = PluginManager.parameters('MyComboGauge');
    var gaugeImage = parameters['Gauge Image'];
    var gaugeWidth = parseInt(parameters['Gauge Width']);
    var gaugeHeight = parseInt(parameters['Gauge Height']);
    var gaugeX = parseInt(parameters['X Position']);
    var gaugeY = parseInt(parameters['Y Position']);

    // Create the combo gauge sprite
    function ComboGauge() {
        this.initialize.apply(this, arguments);
    }

    ComboGauge.prototype = Object.create(Sprite.prototype);
    ComboGauge.prototype.constructor = ComboGauge;

    ComboGauge.prototype.initialize = function() {
        Sprite.prototype.initialize.call(this);
        this.bitmap = ImageManager.loadPicture(gaugeImage);
        this._currentValue = 0;
        this._maxValue = 100;
        this._fillColor = '#ff0000';
        this._backgroundColor = '#ffffff';
        this._drawWidth = gaugeWidth;
        this._drawHeight = gaugeHeight;
        this._frameWidth = this.bitmap.width;
        this._frameHeight = this.bitmap.height;
        this.anchor.x = 0.5;
        this.anchor.y = 0.5;
        this.x = gaugeX;
        this.y = gaugeY;
    };

    ComboGauge.prototype.update = function() {
        Sprite.prototype.update.call(this);
        var comboCount = $gameParty._comboCount;
        if (comboCount) {
            this._currentValue = comboCount;
        } else {
            this._currentValue = 0;
        }
        this.drawGauge();
    };

    ComboGauge.prototype.drawGauge = function() {
        var gaugeWidth = Math.floor(this._currentValue / this._maxValue * this._drawWidth);
        var context = this.bitmap.context;
        context.save();
        context.clearRect(0, 0, this._frameWidth, this._frameHeight);
        context.fillStyle = this._backgroundColor;
        context.fillRect(0, 0, this._drawWidth, this._drawHeight);
        context.fillStyle = this._fillColor;
        context.fillRect(0, 0, gaugeWidth, this._drawHeight);
        context.restore();
    };

    // Add the combo gauge to the game screen
    var _Scene_Battle_createSpriteset = Scene_Battle.prototype.createSpriteset;
    Scene_Battle.prototype.createSpriteset = function() {
        _Scene_Battle_createSpriteset.call(this);
        this._comboGauge = new ComboG
// Register the ComboGauge object with the game
function ComboGauge() {
  this.initialize.apply(this, arguments);
}

ComboGauge.prototype = Object.create(Window_Base.prototype);
ComboGauge.prototype.constructor = ComboGauge;

ComboGauge.prototype.initialize = function(x, y) {
  var width = this.windowWidth();
  var height = this.windowHeight();
  Window_Base.prototype.initialize.call(this, x, y, width, height);
  this._comboCount = 0;
  this.refresh();
};

ComboGauge.prototype.windowWidth = function() {
  return 240;
};

ComboGauge.prototype.windowHeight = function() {
  return this.fittingHeight(1);
};

ComboGauge.prototype.refresh = function() {
  this.contents.clear();
  var x = this.textPadding();
  var y = 0;
  var text = "Combo: " + this._comboCount;
  this.drawText(text, x, y, this.contentsWidth(), "center");
};

ComboGauge.prototype.setComboCount = function(comboCount) {
  this._comboCount = comboCount;
  this.refresh();
};

// Add a method to Game_Battler to increase the combo count
Game_Battler.prototype.increaseComboCount = function() {
  if (!this._comboCount) {
    this._comboCount = 0;
  }
  this._comboCount += 1;
};

// Add a method to Game_Battler to reset the combo count
Game_Battler.prototype.resetComboCount = function() {
  this._comboCount = 0;
};

// Add a method to Scene_Battle to create and update the Combo Gauge
Scene_Battle.prototype.createComboGauge = function() {
  this._comboGauge = new ComboGauge(Graphics.width - 240, 0);
  this.addWindow(this._comboGauge);
};

Scene_Battle.prototype.updateComboGauge = function() {
  if (this._comboGauge) {
    var comboCount = $gameParty.members()[0]._comboCount;
    this._comboGauge.setComboCount(comboCount);
  }
};

// Add a hook to Scene_Battle to create the Combo Gauge window
var _Scene_Battle_createAllWindows = Scene_Battle.prototype.createAllWindows;
Scene_Battle.prototype.createAllWindows = function() {
  _Scene_Battle_createAllWindows.call(this);
  this.createComboGauge();
};

// Add a hook to Scene_Battle to update the Combo Gauge window
var _Scene_Battle_update = Scene_Battle.prototype.update;
Scene_Battle.prototype.update = function() {
  _Scene_Battle_update.call(this);
  this.updateComboGauge();
};

JavaScript:
// MyComboAttacks.js

/*:
 * @plugindesc A plugin that adds combo attacks to battles.
 * @author Nhobson
 * Last update: 3/8/2023
 *
 * @param comboDuration
 * @text Combo Duration
 * @desc The time (in frames) after a successful combo hit that allows for additional hits in the combo.
 * @type number
 * @default 60
 *
 * @param comboInput
 * @text Combo Input
 * @desc The input required to activate the combo attack.
 * @type combo
 * @option Input.up
 * @option Input.down
 * @option Input.left
 * @option Input.right
 *
 * @help
 * To use this plugin, simply install it and set the desired parameters.
 * You can then create combo attacks by setting the 'combo' notetag on skills.
 */

(function () {
    const parameters = PluginManager.parameters('MyComboAttacks');
    const comboDuration = Number(parameters['comboDuration'] || 60);
    const comboInput = parameters['comboInput'] || 'Input.right';

    const _Game_Battler_performDamage = Game_Battler.prototype.performDamage;
    Game_Battler.prototype.performDamage = function () {
        _Game_Battler_performDamage.call(this);
        this._comboHits = 0;
    };

    const _Scene_Battle_createAllWindows = Scene_Battle.prototype.createAllWindows;
    Scene_Battle.prototype.createAllWindows = function () {
        _Scene_Battle_createAllWindows.call(this);
        this.createComboWindow();
    };

    Scene_Battle.prototype.createComboWindow = function () {
        this._comboWindow = new Window_Combo();
        this.addWindow(this._comboWindow);
    };

    const _Game_Action_apply = Game_Action.prototype.apply;
    Game_Action.prototype.apply = function (target) {
        _Game_Action_apply.call(this, target);
        if (this.subject().isActor() && target.isEnemy() && target.result().isHit()) {
            const skill = this.item();
            if (skill.meta.combo) {
                this.subject()._comboHits++;
                const comboHits = this.subject()._comboHits;
                const comboHitsNeeded = Number(skill.meta.combo);
                if (comboHits >= comboHitsNeeded) {
                    this.subject()._comboHits = 0;
                    this.executeComboAttack(skill, comboHitsNeeded);
                }
            }
        }
    };

    Game_Action.prototype.executeComboAttack = function (skill, comboHits) {
        const action = new Game_Action(this.subject());
        action.setSkill(skill.id);
        for (let i = 0; i < comboHits - 1; i++) {
            const lastTarget = BattleManager._targets[0];
            action.apply(lastTarget);
            if (lastTarget.result().isHit()) {
                this.subject()._comboHits++;
            } else {
                break;
            }
        }
        BattleManager.startAction(this.subject(), action, BattleManager._targets);
    };

    function Window_Combo() {
        this.initialize.apply(this, arguments);
    }

    Window_Combo.prototype = Object.create(Window_Base.prototype);
    Window_Combo.prototype.constructor = Window_Combo;

    Window_Combo.prototype.initialize = function () {
        const x = Graphics.boxWidth / 2 - this.windowWidth() / 2;
        const y = Graphics.boxHeight / 2 - this.windowHeight() / 2;
        Window_Base.prototype.initialize.call(this, x, y, this.windowWidth(), this.windowHeight());
        this.opacity = 0;
        this.contentsOpacity = 0;
        this._comboCount = 0;
        this._comboDuration = comboDuration;
MyComboAttacks.prototype.updateComboGauge = function() {
    var gauge = $gameParty._comboGauge;
    var maxCombo = this._parameters.maxCombo;
    var comboSteps = this._parameters.comboSteps;
    var comboStepsValues = this._parameters.comboStepsValues;

    if (gauge < maxCombo) {
        for (var i = 0; i < comboSteps.length; i++) {
            if (gauge >= comboSteps[i]) {
                if (!$gameSwitches.value(comboStepsValues[i])) {
                    $gameSwitches.setValue(comboStepsValues[i], true);
                    this.showComboStepMessage(comboStepsValues[i]);
                }
            }
        }
    }

    this._comboGaugeWindow.refresh();
};

MyComboAttacks.prototype.showComboStepMessage = function(switchId) {
    var message = this._parameters.comboStepMessages[switchId];
    $gameMessage.add(message);
};

MyComboAttacks.prototype.resetComboSwitches = function() {
    var comboStepsValues = this._parameters.comboStepsValues;

    for (var i = 0; i < comboStepsValues.length; i++) {
        $gameSwitches.setValue(comboStepsValues[i], false);
    }
};

MyComboAttacks.prototype.resetComboGauge = function() {
    $gameParty._comboGauge = 0;
    this.resetComboSwitches();
    this.updateComboGauge();
};

})();
Moved to: Plugin Support

Please edit your post and put the plugin in code tags (see how not doing this has changed the formatting? If your plugin worked perfectly, this would break it), and then put that into spoiler tags.

Are you sharing this, or asking for help? I'm not seeing a question.
Moved to: Plugin Support

Please edit your post and put the plugin in code tags (see how not doing this has changed the formatting? If your plugin worked perfectly, this would break it), and then put that into spoiler tags.

Are you sharing this, or asking for help? I'm not seeing a question.
Help really, can't figure out why it's not working.
This is another attempt I made at doing both in a single swoop but it's not activating during battle either.
Spoiler: Battlechain.js
JavaScript:
/*:
 * @plugindesc Allows for combination attacks in RPG Maker MV by filling up a combo bar during battle.
 *             Players can use abilities, attacks, or magics in specific given orders to create additional
 *             effects, abilities, or attacks once the bar is filled. The combo bar can be customized to
 *             match the game's UI with various appearance and location options.
 *
 * @param Combo Bar Visible
 * @desc Whether the combo bar is visible or not. Default is true.
 * @default true
 *
 * @param Combo Bar X Position
 * @desc The X position of the combo bar. Default is 0.
 * @default 0
 *
 * @param Combo Bar Y Position
 * @desc The Y position of the combo bar. Default is 0.
 * @default 0
 *
 * @param Combo Bar Width
 * @desc The width of the combo bar. Default is 200.
 * @default 200
 *
 * @param Combo Bar Height
 * @desc The height of the combo bar. Default is 20.
 * @default 20
 *
 * @param Combo Bar Color 1
 * @desc The first color of the combo bar gradient. Default is #ff0000.
 * @default #ff0000
 *
 * @param Combo Bar Color 2
 * @desc The second color of the combo bar gradient. Default is #ffff00.
 * @default #ffff00
 *
 * @param Combo Bar Font Size
 * @desc The font size of the combo bar text. Default is 16.
 * @default 16
 *
 * @param Combo Bar Font Color
 * @desc The font color of the combo bar text. Default is #ffffff.
 * @default #ffffff
 *
 * @param Combo Bar Fill Requirement
 * @desc The requirement for filling the combo bar. Choose from "Turns", "Actions", or "Damage". Default is Turns.
 * @default Turns
 *
 * @param Combo Bar Fill Amount
 * @desc The amount needed to fill the combo bar based on the fill requirement. Default is 3 turns.
 * @default 3
 *
 * @help
 * To use this plugin, simply install it and enable it in the Plugin Manager.
 *
 * The combo bar will appear in battles and fill up based on the requirements set in the plugin parameters.
 * Once the combo bar is filled, players can use abilities, attacks, or magics in specific given orders to create
 * additional effects, abilities, or attacks.
 *
 * To set up a combo, use the following script command in a skill's note box:
 *    <Combo: x>
 * Where x is the ID of the next skill in the combo. Repeat this command for each skill in the combo in the
 * order they should be used.
 *
 * For example, if Skill 1 has a combo with Skill 2 and Skill 2 has a combo with Skill 3, the note boxes
 * for each skill should look like this:
 *    Skill 1: <Combo: 2>
 *    Skill 2: <Combo: 3>
 *
 * Note that the combo bar will only appear in battles with turn-based battle systems.
 */

(function() {

    var parameters = PluginManager.parameters('MyComboAttacks');
    var comboBarWidth = Number(parameters['Combo Bar Width'] || 200);
    var comboBarHeight = Number(parameters['Combo Bar Height'] || 20);
    var comboBarX = Number(parameters['Combo Bar X'] || 10);
    var comboBarY = Number(parameters['Combo Bar Y'] || 10);
    var comboBarColor1 = String(parameters['Combo Bar Color 1'] || '#00FF00');
    var comboBarColor2 = String(parameters['Combo Bar Color 2'] || '#00AA00');
    var comboFillRate = Number(parameters['Combo Fill Rate'] || 25);
    var comboMax = Number(parameters['Max Combo'] || 3);

    var maxComboCount = 0;
    var currentComboCount = 0;
    var comboBarVisible = false;
    var comboBarFill = 0;

    var _Game_Battler_initMembers = Game_Battler.prototype.initMembers;
    Game_Battler.prototype.initMembers = function() {
        _Game_Battler_initMembers.call(this);
        this._comboCount = 0;
    };

    Game_Battler.prototype.increaseComboCount = function() {
        this._comboCount++;
        if (this._comboCount > maxComboCount) {
            this._comboCount = maxComboCount;
        }
        comboBarFill = this._comboCount * (100 / maxComboCount);
    };

    Game_Battler.prototype.resetComboCount = function() {
        this._comboCount = 0;
        comboBarFill = 0;
    };

    var _BattleManager_initMembers = BattleManager.initMembers;
    BattleManager.initMembers = function() {
        _BattleManager_initMembers.call(this);
        maxComboCount = comboMax;
        currentComboCount = 0;
        comboBarVisible = false;
        comboBarFill = 0;
    };

    var _BattleManager_startAction = BattleManager.startAction;
    BattleManager.startAction = function() {
        _BattleManager_startAction.call(this);
        this.subject().resetComboCount();
    };

    var _Game_Action_apply = Game_Action.prototype.apply;
    Game_Action.prototype.apply = function(target) {
        _Game_Action_apply.call(this, target);
        if (this.subject().isActor()) {
            this.subject().increaseComboCount();
        }
    };

    var _Scene_Battle_createSpriteset = Scene_Battle.prototype.createSpriteset;
    Scene_Battle.prototype.createSpriteset = function() {
        _Scene_Battle_createSpriteset.call(this);
        this.createComboBar();
    };

    Scene_Battle.prototype.createComboBar = function() {
        this._comboBar = new Sprite();
        this._comboBar.bitmap = new Bitmap(comboBarWidth, comboBarHeight);
        this._comboBar.x = comboBarX;
        this._comboBar.y = comboBarY;
        this._comboBar.bitmap.gradientFillRect(0, 0, comboBarWidth, comboBarHeight, comboBarColor1, comboBarColor2, true);
        this._comboBar.visible = comboBarVisible;
        this.addChild(this._comboBar);
    };

    var _Scene_Battle_update = Scene_Battle.prototype.update;
    Scene_Battle.prototype.update = function() {
        _Scene_Battle_update.call(this);
        if (comboBarVisible) {
            this.updateComboBar();
        }
    };

    Scene_Battle.prototype.updateComboBar = function() {
        if (currentComboCount < this._spriteset._actorSprites.length) {
            currentComboCount = this._sprites
// Check if combo can be executed
BattleManager.canExecuteCombo = function() {
  var combo = MyComboAttacks.currentCombo;
  if (!combo) {
    return false;
  }
  if (combo.skills.length !== MyComboAttacks.requiredCombo.length) {
    return false;
  }
  for (var i = 0; i < combo.skills.length; i++) {
    if (combo.skills[i] !== MyComboAttacks.requiredCombo[i]) {
      return false;
    }
  }
  return true;
};

// Execute the combo
BattleManager.executeCombo = function() {
  var combo = MyComboAttacks.currentCombo;
  if (!combo) {
    return;
  }
  var user = MyComboAttacks.currentUser;
  var action = new Game_Action(user);
  for (var i = 0; i < combo.skills.length; i++) {
    var skillId = combo.skills[i];
    action.setSkill(skillId);
    action.apply(user);
  }
  MyComboAttacks.currentCombo = null;
  MyComboAttacks.currentUser = null;
  MyComboAttacks.currentCount = 0;
  MyComboAttacks.currentMaxCount = 0;
};

// Override the original useItem method
var _Game_Battler_useItem = Game_Battler.prototype.useItem;
Game_Battler.prototype.useItem = function(item) {
  if (item.meta.combo) {
    if (MyComboAttacks.currentCombo) {
      return;
    }
    MyComboAttacks.currentCombo = new Combo();
    MyComboAttacks.requiredCombo = item.meta.combo.split(",").map(Number);
    MyComboAttacks.currentCount = 0;
    MyComboAttacks.currentMaxCount = MyComboAttacks.comboBarDuration;
    MyComboAttacks.currentUser = this;
  }
  _Game_Battler_useItem.call(this, item);
};

// Override the original update method
var _Scene_Battle_update = Scene_Battle.prototype.update;
Scene_Battle.prototype.update = function() {
  _Scene_Battle_update.call(this);
  if (MyComboAttacks.currentCombo) {
    MyComboAttacks.currentCount++;
    if (MyComboAttacks.currentCount >= MyComboAttacks.currentMaxCount) {
      MyComboAttacks.currentCombo = null;
      MyComboAttacks.currentUser = null;
      MyComboAttacks.currentCount = 0;
      MyComboAttacks.currentMaxCount = 0;
    }
  }
};

})();
The first issue I notice is that your line that adds the combo gauge to the spriteset is only half-written so that's probably causing an error that prevents the rest of the plugin from executing.
The first issue I notice is that your line that adds the combo gauge to the spriteset is only half-written so that's probably causing an error that prevents the rest of the plugin from executing.
I think I found the spot you pointed out, thank you. Here's the most updated versions. Still can't get the dang thing goin.


Spoiler: MyComboGauge.js
JavaScript:
//=============================================================================
// MyComboGauge.js
//=============================================================================

/*:
 * @plugindesc Adds a combo gauge for the MyComboAttacks plugin.
 * @author Nhobson
 *
 * @param Gauge Width
 * @desc The width of the gauge in pixels.
 * @default 200
 * @type number
 *
 * @param Gauge Height
 * @desc The height of the gauge in pixels.
 * @default 20
 * @type number
 *
 * @param Gauge Color 1
 * @Desc the color of the empty gauge
 * @default #ff0000
 *
 * @param Gauge Color 2
 * @Desc the color of the filled gauge
 * @default #ffff00
 *
 * @param X Position
 * @desc The X position of the gauge on the screen.
 * @default 10
 * @type number
 *
 * @param Y Position
 * @desc The Y position of the gauge on the screen.
 * @default 10
 * @type number
 *
 * @help
 * This plugin adds a combo gauge for the MyComboAttacks plugin.
 */

(function() {

    var parameters = PluginManager.parameters('MyComboGauge');
    var gaugeWidth = parseInt(parameters['Gauge Width']);
    var gaugeHeight = parseInt(parameters['Gauge Height']);
    var gaugeX = parseInt(parameters['X Position']);
    var gaugeY = parseInt(parameters['Y Position']);

    // Create the combo gauge sprite
    function ComboGauge() {
        this.initialize.apply(this, arguments);
    }

    ComboGauge.prototype = Object.create(Sprite.prototype);
    ComboGauge.prototype.constructor = ComboGauge;

    ComboGauge.prototype.initialize = function() {
        Sprite.prototype.initialize.call(this);
        this._currentValue = 0;
        this._maxValue = 100;
        this._fillColor = '#ff0000';
        this._backgroundColor = '#ffffff';
        this._drawWidth = gaugeWidth;
        this._drawHeight = gaugeHeight;
        this.anchor.x = 0.5;
        this.anchor.y = 0.5;
        this.x = gaugeX;
        this.y = gaugeY;
    };

    ComboGauge.prototype.update = function() {
        Sprite.prototype.update.call(this);
        var comboCount = $gameParty.members()[0]._comboCount;
        if (comboCount) {
            this._currentValue = comboCount;
        } else {
            this._currentValue = 0;
        }
        this.drawGauge();
    };

    ComboGauge.prototype.drawGauge = function() {
        var gaugeWidth = Math.floor(this._currentValue / this._maxValue * this._drawWidth);
        var context = this.bitmap.context;
        context.save();
        context.clearRect(0, 0, this._drawWidth, this._drawHeight);
        context.fillStyle = this._backgroundColor;
        context.fillRect(0, 0, this._drawWidth, this._drawHeight);
        context.fillStyle = this._fillColor;
        context.fillRect(0, 0, gaugeWidth, this._drawHeight);
        context.restore();
    };

    // Add the combo gauge to the scene
    var _Scene_Map_createSprites = Scene_Map.prototype.createSprites;
    Scene_Map.prototype.createSprites = function() {
        _Scene_Map_createSprites.call(this);
        this._comboGauge = new ComboGauge();
        this.addChild(this._comboGauge);
    };

})();
Spoiler: MyComboAttacks.js
Code:
// MyComboAttacks.js

/*:
 * @plugindesc A plugin that adds combo attacks to battles.
 * @author Nhobson
 * Last update: 3/8/2023
 *
 * @param comboDuration
 * @text Combo Duration
 * @desc The time (in frames) after a successful combo hit that allows for additional hits in the combo.
 * @type number
 * @default 60
 *
 * @param comboInput
 * @text Combo Input
 * @desc The input required to activate the combo attack.
 * @type combo
 * @option Input.up
 * @option Input.down
 * @option Input.left
 * @option Input.right
 * @option Input.action
 *
 * @help
 * To use this plugin, simply install it and set the desired parameters.
 * You can then create combo attacks by setting the 'combo' notetag on skills.
 */


var MyComboGauge = MyComboGauge || {};

(function () {
    const parameters = PluginManager.parameters('MyComboAttacks');
    const comboDuration = Number(parameters['comboDuration'] || 60);
    const comboInput = parameters['comboInput'] || 'Input.right';

    const _Game_Battler_performDamage = Game_Battler.prototype.performDamage;
    Game_Battler.prototype.performDamage = function () {
        _Game_Battler_performDamage.call(this);
        this._comboHits = 0;
    };

    const _Scene_Battle_createAllWindows = Scene_Battle.prototype.createAllWindows;
    Scene_Battle.prototype.createAllWindows = function () {
        _Scene_Battle_createAllWindows.call(this);
        this.createComboWindow();
    };

    Scene_Battle.prototype.createComboWindow = function () {
        this._comboWindow = new Window_Combo();
        this.addWindow(this._comboWindow);
    };

    const _Game_Action_apply = Game_Action.prototype.apply;
    Game_Action.prototype.apply = function (target) {
        _Game_Action_apply.call(this, target);
        if (this.subject().isActor() && target.isEnemy() && target.result().isHit()) {
            const skill = this.item();
            if (skill.meta.combo) {
                this.subject()._comboHits++;
                const comboHits = this.subject()._comboHits;
                const comboHitsNeeded = Number(skill.meta.combo);
                if (comboHits >= comboHitsNeeded) {
                    this.subject()._comboHits = 0;
                    this.executeComboAttack(skill, comboHitsNeeded);
                }
            }
        }
    };

    Game_Action.prototype.executeComboAttack = function (skill, comboHits) {
        const action = new Game_Action(this.subject());
        action.setSkill(skill.id);
        for (let i = 0; i < comboHits - 1; i++) {
            const lastTarget = BattleManager._targets[0];
            action.apply(lastTarget);
            if (lastTarget.result().isHit()) {
                this.subject()._comboHits++;
            } else {
                break;
            }
        }
        BattleManager.startAction(this.subject(), action, BattleManager._targets);
    };

    function Window_Combo() {
        this.initialize.apply(this, arguments);
    }

    Window_Combo.prototype = Object.create(Window_Base.prototype);
    Window_Combo.prototype.constructor = Window_Combo;

    Window_Combo.prototype.initialize = function () {
        const x = Graphics.boxWidth / 2 - this.windowWidth() / 2;
        const y = Graphics.boxHeight / 2 - this.windowHeight() / 2;
        Window_Base.prototype.initialize.call(this, x, y, this.windowWidth(), this.windowHeight());
        this.opacity = 0;
        this.contentsOpacity = 0;
        this._comboCount = 0;
        this._comboDuration = comboDuration;
MyComboAttacks.prototype.updateComboGauge = function() {
    var gauge = MyComboGauge.comboGauge;
    var maxCombo = this._parameters.maxCombo;
    var comboSteps = this._parameters.comboSteps;
    var comboStepsValues = this._parameters.comboStepsValues;

    if (gauge < maxCombo) {
        for (var i = 0; i < comboSteps.length; i++) {
            if (gauge >= comboSteps[i]) {
                if (!$gameSwitches.value(comboStepsValues[i])) {
                    $gameSwitches.setValue(comboStepsValues[i], true);
                    this.showComboStepMessage(comboStepsValues[i]);
                }
            }
        }
    }

    this._comboGaugeWindow.refresh();
};

MyComboAttacks.prototype.showComboStepMessage = function(switchId) {
    var message = this._parameters.comboStepMessages[switchId];
    $gameMessage.add(message);
};

MyComboAttacks.prototype.resetComboSwitches = function() {
    var comboStepsValues = this._parameters.comboStepsValues;

    for (var i = 0; i < comboStepsValues.length; i++) {
        $gameSwitches.setValue(comboStepsValues[i], false);
    }
};

MyComboAttacks.prototype.resetComboGauge = function() {
    MyComboGauge.comboGauge = 0;
    this.resetComboSwitches();
    this.updateComboGauge();
};

})();

Original thread: https://forums.rpgmakerweb.com/threads/battle-plugin-combining-attacks-with-timing-function.155638/