MV Variable that changes default attack skill

For RPG Maker MV, by default selecting the attack command uses skill #1, set as "Attack" and just doing basic damage. In my game, I'm using a timed button press system. But I understand that some users strongly dislike timed button systems and/or cannot do them due to a physical inhibition. Accordingly, I want the user to be able to turn off the timed button system if so desired.

This can be done easily if I have two different attack skills - one that uses the timed button system, and one that does not. The player would open the settings menu and change a variable in order to change what the "Attack" command does: skill one or skill 2.

I'm wanting, basically, to be able to set up a variable (call it DefaultAttack) that changes what the default attack skill is. If the variable is set to 1, then skill #1 is called by the attack command. If the variable is set to 2, then skill #2 is called by the attack command. I see no way with the default editor to change what the attack command will do. Is there a plugin that'll allow me to do this?
There are. For example with Yanfly's paid plugin Weapon Unleash (http://www.yanfly.moe/wiki/Weapon_Unleash_(YEP) ) You could use a custom replace attack notetag to set the skill id for the attack command to the content of a variable.

If you are looking for free alternatives, I believe I saw something from Victor Engine (maybe?) that could also accomplish this. Though I didn't really look into it.
There are. For example with Yanfly's paid plugin Weapon Unleash (http://www.yanfly.moe/wiki/Weapon_Unleash_(YEP) ) You could use a custom replace attack notetag to set the skill id for the attack command to the content of a variable.

If you are looking for free alternatives, I believe I saw something from Victor Engine (maybe?) that could also accomplish this. Though I didn't really look into it.
I had looked through VE but didn't see any. Just double-checked again but still am not seeing it. I may just buy Yanfly's script.
Word of advice: buy the full bundle for 30$. In my opinion it is totally worth it. And it is way cheaper than buying a single bundle for 10$ and later another one, and later another one, ...
I'm wanting, basically, to be able to set up a variable (call it DefaultAttack) that changes what the default attack skill is. If the variable is set to 1, then skill #1 is called by the attack command. If the variable is set to 2, then skill #2 is called by the attack command. I see no way with the default editor to change what the attack command will do. Is there a plugin that'll allow me to do this?
îf you only have 2 options, you dont need a variable, a switch can solve that aswell..

the default "rpg objects" plugin has:
JavaScript:
Game_BattlerBase.prototype.attackSkillId = function() {
    return 1;
};

so you could overwrite this with something that says :
if (switch false) return 1
if (switch true) return //put your skill id here

you could also replace the "1" with the value of a $gameVaribable,..
and this way you can always change the skill by changing the variable..

Spoiler: first examples
examples: using "11" as example for the other skill..
JavaScript:
Game_BattlerBase.prototype.attackSkillId = function() {
if (!$gameSwitches.value(switch_ID)) return 1;
// this above means switch "false"
if ($gameSwitches.value(switch_ID)) return 11;
// this above means switch "true"
};
// you need to add the Switch_ID !!

example using variable value:
this requires that the used $gamevariable has always any value

JavaScript:
Game_BattlerBase.prototype.attackSkillId = function() {
    return $gameVariables.value(Variable_ID);
};
// you need to add the variable ID !!
edit
i forgot this(first examples spoiler) would affect all battlers , also enemys!!


if that is not wanted , than we need another condition that checks if the battler is an enemy or actor, ..
...you also could make this only usable for specific actor ids

same examples but with the "is actor" check:
JavaScript:
Game_BattlerBase.prototype.attackSkillId = function() {
  if (this.isActor()) {
      if (!$gameSwitches.value(switch_ID)) return 1;
      // this above means switch "false"
      if ($gameSwitches.value(switch_ID)) return 11;
      // this above means switch "true"
  } else {return 1};
};
// you need to add the Switch_ID !!

JavaScript:
Game_BattlerBase.prototype.attackSkillId = function() {
  if (this.isActor()) {
      return $gameVariables.value(Variable_ID);
  } else {return 1};
};
// you need to add the variable ID !!
@dopan Thank you so much! I got it working perfectly with that code.

Original thread: https://forums.rpgmakerweb.com/threads/variable-that-changes-default-attack-skill.143957/