skip one confirmation button press SRD_StatDistribution

Hello guys,
I would like to ask your help to change a simple thing in this plugin:

stat plugin chages.jpg

- I know that doing this the only way to exit the window will be pressing the cancel button on the keyboard.
It´s ok for me


I'm asking for this because I would like to skip the "Spend" button press step.


That´s it! Thank you very much in advance for help me!

Here is the plugin:
http://sumrndm.site/stat-distribution/
FYI from SRD's terms of use:

– You are NOT allowed to redistribute these Plugins.

Better to remove the attachment & code from your post and just put a link to the plugin. It has the added benefit of always linking to the most updated version (it won't be different here, but it's good advice in general)
@Aloe Guvner thank you! I didn´t know that!
Consider it done!
Please, it's possible to do that? I'm not good with code so I need some help.

Thank you in advance.
Sorry guys! Please, anyone can help me?
Bump. I don´t know how to do this on my own. :asad:
Hello!! Please let me know, does it´s something very hard to do? Because if it is, then I will find another way, may be another plugin.

Thank you in advance!
bump
bump :hswt:
Hey I'll take a look tonight. Any extra considerations or weird behaviors? Seems pretty straightforward
@Aloe Guvner Hello!!! Thank you for your help!!
Any extra considerations or weird behaviors?
No, the plugin works perfectly. In my case, this change is only to facilitate the mechanism for the user. Because my game is for mobile, and it's kind of weird that step of pressing the "spend" button.
When the player presses "Finish", what would happen? They return to the main menu?

Edit:
Here's the code, add as a new plugin directly below SRD_StatDistribution
The following modifications are done:
  1. The command window no longer appears
  2. The distribution window is auto selected
  3. Pressing "Finish" from the distribution exits the scene
  4. Pressing cancel from the distribution window also exits the scene
  5. PageUp & PageDown switches actors in the distribution window
Spoiler
Code:
/*:
 * @plugindesc Modifies SRD_StatDistribution to remove the command window
*  ALOE_SRD_StatDistribution_Mod
 * @author Aloe Guvner
 *
 * @help
 * The following modifications are done:
 * 1. The command window no longer appears
 * 2. The distribution window is auto selected
 * 3. Pressing "Finish" from the distribution exits the scene
 * 4. Pressing cancel from the distribution window also exist the scene
 * 5. PageUp & PageDown switches actors in the distribution window
 *
 */

(function(){
    
/** Overwrite this method to create the window but not add it visually to the scene */
Scene_Distribute.prototype.createCommandWindow = function() {
    const wy = this._helpWindow.height;
    this._commandWindow = new Window_DistributeCommand(0, wy);
    this._commandWindow.setHelpWindow(this._helpWindow);
};

var Scene_Distribute_distributeFinish = Scene_Distribute.prototype.distributeFinish;
Scene_Distribute.prototype.distributeFinish = function() {
    Scene_Distribute_distributeFinish.call(this);
    this.popScene();
};

var Scene_Distribute_distributeCancel = Scene_Distribute.prototype.distributeCancel;
Scene_Distribute.prototype.distributeCancel = function() {
    Scene_Distribute_distributeCancel.call(this);
    this.popScene();
};

var Scene_Distribute_create = Scene_Distribute.prototype.create;
Scene_Distribute.prototype.create = function() {
    Scene_Distribute_create.call(this);
    this.commandSpend();
};

var Scene_Distribute_createDistributeWindow = Scene_Distribute.prototype.createDistributeWindow;
Scene_Distribute.prototype.createDistributeWindow = function() {
    Scene_Distribute_createDistributeWindow.call(this);
    this._distributeWindow.setHandler('pagedown', this.distributeNextActor.bind(this));
    this._distributeWindow.setHandler('pageup',   this.distributePreviousActor.bind(this));
};

Scene_Distribute.prototype.distributeNextActor = function() {
    this._distributeWindow.restartInfo();
    this.distributeEnd();
    this.nextActor();
    this.commandSpend();
};

Scene_Distribute.prototype.distributePreviousActor = function() {
    this._distributeWindow.restartInfo();
    this.distributeEnd();
    this.previousActor();
    this.commandSpend();
};

})();
Wonderful!! I'd give you a thousand likes if I could. It worked perfectly!
Thank you very much, this was very important to me!

Original thread: https://forums.rpgmakerweb.com/threads/skip-one-confirmation-button-press-srd_statdistribution.105609/