MV I would like to fix a bug in the 'Command Remember' option in the 'SRD_SkillExtender.js' plugin.

hello. I am a novice creator making games with RPG MV.
I was looking for a plugin to further refine skills in the game, and found the 'SRD_SkillExtender.js' plugin.
This plugin allows developers to create skills that prompt players to make a second input after the original skill input.

After using the plug-in, I was very happy because no errors or problems were found. but..
I recently found out that a small bug exists.
I definitely checked 'Command Remember' to ON in the options menu, but the second input window skill through the plugin is not remembered, and the command is always reset.

'Attack', 'Defense', and 'Items' In addition, 'skills' that do not go through the plugin still remember the commands, and the cursor is automatically fixed to the previously entered action during the next action.
However, I can't remember the command for the second input 'skill' using the plugin.
So, if you input a skill through the plug-in, you will have to move the arrow keys again for other actions, and above all, uniformity will be lost.

I wanted to fix this little bug.
So I contacted the plugin creator, but didn't hear back.
And, when I looked at the site where I downloaded the plugin, I saw that the MV version of the plugin had not been updated for 6 years. It was a pity.

However, there didn't seem to be a relatively large amount of script. I thought I might be able to modify it, so I looked into it, but in the end, everything failed.

I am..

_.Scene_Battle_onSkillOk = Scene_Battle.prototype.onSkillOk;
Scene_Battle.prototype.onSkillOk = function() {
var skill = this._skillWindow.item();
if(skill._se_extendSkills) {
this.openSkillExtendWindow(skill);
} else {
_.Scene_Battle_onSkillOk.apply(this, arguments);
}
};

This part...

_.Scene_Battle_onSkillOk = Scene_Battle.prototype.onSkillOk;
Scene_Battle.prototype.onSkillOk = function() {
var skill = this._skillWindow.item();
if(skill._se_extendSkills) {
this.openSkillExtendWindow(skill);
BattleManager.inputtingAction().setSkill(skill.id);
BattleManager.actor().setLastBattleSkill(skill);
BattleManager.inputtingAction().setItem(skill);
BattleManager.actor().setLastCommandSymbol('skill');
BattleManager.actor().setLastMenuSkill(skill);
} else {
_.Scene_Battle_onSkillOk.apply(this, arguments);
}
};

..I modified it like this. (The result was a failure.. )

What I'm hoping for is simply the addition of a function to remember commands.
Since this is a basic function that has been around since the beginning, I believe it definitely has potential.

Since I am still a beginner, I have no experience creating plugins. However, I am learning about plugins little by little by researching and researching various plugins.
Please help me. I'm writing this because I think people who are good at using scripts and plugins may be able to easily get help.
Could you please tell me how to edit the script code of that plugin?

Below I will list the site where you can download the plugin. Please, please, please. everyone.


English is not my native language, so I apologize for the rough sentences.
What I'm hoping for is simply the addition of a function to remember commands.
That is where you went wrong from the start.

you can't remember anything with a function - to remember something you need a variable to store that something in.

and in this case the exiosting variables obviously only allow for storing the regular input, not anything done with the second input.
so yoU#ll need to create variables to store that before you can write functions to store and retrieve the stored data.
That is where you went wrong from the start.

you can't remember anything with a function - to remember something you need a variable to store that something in.

and in this case the exiosting variables obviously only allow for storing the regular input, not anything done with the second input.
so yoU#ll need to create variables to store that before you can write functions to store and retrieve the stored data.

Thanks for your reply.
I tried several things using your advice.
Maybe I was lucky, but I got some small results.
The selection of the 'second skill list' due to the plugin has been modified so that the command is remembered. However, I can't remember the command to click on the second skill list.

For example, when you select and click 'Magic' -> 'Lightning Magic' -> 'Thunderbolt' in the actor command... When you click 'Lightning Magic' in the next action, the 'Thunderbolt' used in the last action is used. 'Thunderbolt' was remembered and the cursor was modified to automatically move to Thunderbolt.

However, I couldn't remember the 'Magic' -> 'Lightning Magic' command, so I had to manually move the arrow keys and click.

I'm trying to edit it further, but it's not working. Is there any good way? please..

Below is a record of the changes I made.

Scene_Battle.prototype.openSkillExtendWindow = function(skill) {
this._skillExtend.setup(skill);
this._skillExtend.open();
this._skillExtend.select(0);
this._skillExtend.activate();
};
_.Scene_Battle_onSkillOk = Scene_Battle.prototype.onSkillOk;
Scene_Battle.prototype.onSkillOk = function() {
var skill = this._skillWindow.item();
if(skill._se_extendSkills) {
this.openSkillExtendWindow(skill);
} else {
_.Scene_Battle_onSkillOk.apply(this, arguments);
}
};

By editing...

var lastSelectedSkill = null;
var lastSelectedSkillExtend = null;

Scene_Battle.prototype.openSkillExtendWindow = function(skill) {
this._skillExtend.setup(skill);
this._skillExtend.open();
this._skillExtend.select(0);
this._skillExtend.activate();
var selectedCommand = lastSelectedSkillExtend || this._skillExtend.item();
if (selectedCommand) {
this._skillExtend.select(this._skillExtend._data.indexOf(selectedCommand));
}
};

_.Scene_Battle_onSkillOk = Scene_Battle.prototype.onSkillOk;
Scene_Battle.prototype.onSkillOk = function() {
var skill = this._skillWindow.item();
if (skill._se_extendSkills) {
lastSelectedSkill = skill;
lastSelectedSkillExtend = this._skillExtend.item();
this.openSkillExtendWindow(skill);
} else {
_.Scene_Battle_onSkillOk.apply(this, arguments);
lastSelectedSkill = this._skillWindow.item();
}
};

Changed it to .
When you post code, please use the CODE tag (the </> on the edit bar). That will preserve indentation and braces so your code is more readable.

The Skill Extender already saves the last selected skill the same way the regular skill menu does. All you should have to do (theoretically) is add one line of code to set the cursor when the window opens.

Edit: Nope, that makes no sense because it's already in the initialize that's being called.

Original thread: https://forums.rpgmakerweb.com/threads/i-would-like-to-fix-a-bug-in-the-command-remember-option-in-the-srd_skillextender-js-plugin.162997/