VXAce Attempting normal attacks that change depending on the character's state.

Hello, this is my first post here, English isn't my first language and I'm not familiar with posting on forums., but I'll do my best to explain.

I need help with a Yanfly script, Battle Command List. I'm trying to create a mechanic where the character activates a buff and their normal attack changes according to the buff.

For example: there's this character who uses a skill giving her a buff changing their animation and element of the normal attack, but it's just the switch being activated that makes the skill appear in the command list.

I'm using the script's switch option to make them appear at the right time, but I think I did something wrong and they don't deactivate when the buff goes away. I just need help with that.

Or show me a way to do it. I've searched and searched for a practical tutorial and only found Google's AI, which is very frustrating (I didn't use its tutorials).
I hope I didn't sound rude or cold, I just want help, thank you for reading.
Hello, and welcome to the forums!

Yanfly's script doesn't really have a way to do what you want, but Hime has these two scripts which should work:
Hime Command Manager
Hime Attack Skill Command

The you would put this notetag on the actor:
Code:
<attack skill>
  id: a.state?(x) ? y : 1
</attack skill>

Replace x with the id of state that gets applied by the skill, and y with the id of the skill that will replace the attack skill.

If you want to keep using Yanfly's script, just let me know and I can write a addon for it so that a command only appears when the user has a specific state.
Hello, and welcome to the forums!

Yanfly's script doesn't really have a way to do what you want, but Hime has these two scripts which should work:
Hime Command Manager
Hime Attack Skill Command

The you would put this notetag on the actor:
Code:
<attack skill>
  id: a.state?(x) ? y : 1
</attack skill>

Replace x with the id of state that gets applied by the skill, and y with the id of the skill that will replace the attack skill.

If you want to keep using Yanfly's script, just let me know and I can write a addon for it so that a command only appears when the user has a specific state.
First, thank you for replying, I'm very happy.

I would like to ask another question, I should have written my first post better. I'm using the Victor Engine scripts for the side battle. I should have put this in the first post; I think it's important information, but if not, sorry.

All characters will have unique normal attacks, so I separated the files for these attacks into database animations. This character has 4 different animations: One for the common normal attack, and 3 others for each skill that will change its element and animation, one skill will give a fire buff, another an ice buff, etc. I found it much better to separate them since I feel it gave more freedom in certain aspects. I also wanted to understand this.

I had tested the HimeWorks version and it was going well, but the animations weren't working, but I was probably doing something wrong. I will test the HimeWorks version when possible today and will give an answer.

I hope I explained it better; rereading the first post, I summarized it a lot, and thank you again.
After doing a bit of testing, I found out that the problem was with Hime's script.
To fix it, go to Hime's Attack Skill Command script, go to line 111(this section):
Ruby:
case data
when /.*id:\s*(.*)\s*/i
    attack_skill_id = 1 #<- add this right here
    attack_skill_formula = $1
when /.*priority:\s*(\d+)\s*/i
    priority = $1.to_i
end
Then just add in the attack_skill_id = 1 line in the same place.
After doing a bit of testing, I found out that the problem was with Hime's script.
To fix it, go to Hime's Attack Skill Command script, go to line 111(this section):
Ruby:
case data
when /.*id:\s*(.*)\s*/i
    attack_skill_id = 1 #<- add this right here
    attack_skill_formula = $1
when /.*priority:\s*(\d+)\s*/i
    priority = $1.to_i
end
Then just add in the attack_skill_id = 1 line in the same place.
Hello, and thank you again.
I did what you asked and the animations still didn't work.
Captura de tela 2026-01-19 210213.png
I should have sent a picture of my scripts earlier, so I'll leave a screenshot.
Captura de tela 2026-01-19 211849.png

You don't need to test all of that, I just wanted to know if I can still request the add-on for Yanfly's Battle Command List, since it doesn't affect the animations running. I don't really know which scripts are conflicting to cause this, and I don't have enough words to thank you for trying to help me.
If I'm understanding your problem correctly, I can think of a way to do this, if one that's slightly clunky. Give this character both attacks as separate commands, and give the buffed attack the <hide until usable> string. Instead of needing a switch to turn it on and off, you can have the state itself just add the buffed attack to the character, and seal the normal attack. that should work without requiring a switch.
@BunnyTan I finished the Yanfly state add-on. Here you go!

Ruby:
=begin
-------
 * State Req add-on for Yanfly Engine Ace - Battle Command List
 
 
 This add-on allows you to require that the user has a specific
 state for a command to appear.
 
 To use, simply notetag a skill with:
 
 <command hide until state: x>

 where x is the id of the required state.
 
-------
=end
if $imported["YEA-BattleCommandList"]

module YEA
  module REGEXP
    module USABLEITEM
      
    COMMAND_HIDE_STATE =
      /<(?:COMMAND_HIDE_UNTIL_STATE|command hide until state):[ ](\d+)>/i
      
    end # USABLEITEM
  end # REGEXP
end # YEA

class RPG::UsableItem < RPG::BaseItem
 
  attr_accessor :command_hide_until_state
 
  alias hb_state_req_load_notetags_bcl load_notetags_bcl
  def load_notetags_bcl
    @command_hide_until_state = 0
    hb_state_req_load_notetags_bcl
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_STATE
        @command_hide_until_state = $1.to_i
      end
    }
  end

end

class Window_ActorCommand
 
  alias hb_add_use_skill_state add_use_skill?
  def add_use_skill?(skill_id)
    skill = $data_skills[skill_id]
    return false if hide_until_state?(skill)
    hb_add_use_skill_state(skill_id)
  end
 
  def hide_until_state?(skill)
    return false unless skill.command_hide_until_state > 0
    return false if @actor.state?(skill.command_hide_until_state)
    return true
  end
 
end

end#if $imported["BattleCommandList"]
@BunnyTan I finished the Yanfly state add-on. Here you go!

Ruby:
=begin
-------
 * State Req add-on for Yanfly Engine Ace - Battle Command List
 
 
 This add-on allows you to require that the user has a specific
 state for a command to appear.
 
 To use, simply notetag a skill with:
 
 <command hide until state: x>

 where x is the id of the required state.
 
-------
=end
if $imported["YEA-BattleCommandList"]

module YEA
  module REGEXP
    module USABLEITEM
     
    COMMAND_HIDE_STATE =
      /<(?:COMMAND_HIDE_UNTIL_STATE|command hide until state):[ ](\d+)>/i
     
    end # USABLEITEM
  end # REGEXP
end # YEA

class RPG::UsableItem < RPG::BaseItem
 
  attr_accessor :command_hide_until_state
 
  alias hb_state_req_load_notetags_bcl load_notetags_bcl
  def load_notetags_bcl
    @command_hide_until_state = 0
    hb_state_req_load_notetags_bcl
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_STATE
        @command_hide_until_state = $1.to_i
      end
    }
  end

end

class Window_ActorCommand
 
  alias hb_add_use_skill_state add_use_skill?
  def add_use_skill?(skill_id)
    skill = $data_skills[skill_id]
    return false if hide_until_state?(skill)
    hb_add_use_skill_state(skill_id)
  end
 
  def hide_until_state?(skill)
    return false unless skill.command_hide_until_state > 0
    return false if @actor.state?(skill.command_hide_until_state)
    return true
  end
 
end

end#if $imported["BattleCommandList"]
THANK YOU SO MUCH
It's working perfectly! Thank you so much! I'll post a link to a video I made to show you! Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/attempting-normal-attacks-that-change-depending-on-the-characters-state.182041/