How to Prevent Certain Battle Skills from Being Unequipped.

Hi everyone,
I’m using Yanfly’s Equip Battle Skills plugin, and in my game there are some skills that are essential to the core mechanics and the overall flow of battles. Because of this, I’d like those skills to be impossible to unequip.
In other words, players should be able to equip and unequip any skill except these specific ones. Is there any way to achieve this with the plugin (or through a workaround)? 😅
Hmmm, make an edit to put a condition that it won't advance if the index of the "slot" is less than X. For example like this, you can't change the first 2 skills (index has to be > 1). You can equip the "locked" slots with scripts at game start. And also make it so with skill types (or tags?) that those locked skills don't appear on the list so that the player can't mess it up by swapping the stuff.

Copy paste to notepad, save as .js file and add as a plugin. I think this should work:

Yanfly.EBS.Scene_Skill_onItemOk = Scene_Skill.prototype.onItemOk;
Scene_Skill.prototype.onItemOk = function() {
if (this._skillTypeWindow.currentExt() === 'battleSkills') {
if (this._itemWindow.index() > 1) {
this.openSkillEquipWindows();
} else {
this._itemWindow.activate();
}
} else {
Yanfly.EBS.Scene_Skill_onItemOk.call(this);
}
};

EDIT: Oh yeah you might want to also edit the processOk method for that window to not play the ok sound in those instances if that bothers you. And if you want something to indicate that they're locked skills, you can edit the draw method.
EDIT2: Also, maybe you could do the whole check thing with the processOk method too, but whatever.
EDIT3: Or use the isEnabled method, depending how you want it to look.
Thank you so much!!! It worked!!! 😤

Original thread: https://forums.rpgmakerweb.com/threads/how-to-prevent-certain-battle-skills-from-being-unequipped.182183/