Skill Change based on State

(Using Yanfly plugins)
So, I have a skill I'm trying to make work called Bleeding Edge. There are 3 skills called Bleeding Edge, and they are *supposed* to swap out depending on what state the caster is affected with.

1. Bleeding Edge (Default): Appears in the skill list by default. This skill will disappear and be replaced by either of the following skills when their respective states are applied.
2. Bleeding Edge (X): This replaces the default when State X is applied. Default shouldn't even be visible at this point.
3. Bleeding Edge (Y): same as above, but state Y is applied. X and Y will never exist at the same time so that shouldn't be a concern.

Now I actually have a start on this, however it isn't complete. I can get it to do the swap correctly with the X skill with this:

Spoiler: On the Default skill:
JavaScript:
<Custom Show Eval>

if (!user.hasSkill(X)) user.learnSkill(X);

visible = !user.isStateAffected(X);

</Custom Show Eval>

Spoiler: On the X skill:
JavaScript:
<Custom Show Eval>
visible = user.isStateAffected(X);
</Custom Show Eval>

Problem I'm having with this is trying to get state Y and skill Y involved. My JS knowledge is very limited, so if the answer is extremely obvious I apologize.
I have something very similar to this. Basically, on the skill you’d want to swap in (bleeding edge x and y), in the note area add this tag:

<Custom Show Eval>
visible = user.isStateAffected(x);
</Custom Show Eval>

Make sure your character can learn the swap in skill, in their class note area; if you’re using skill core you should have a tag that says <Learn Skill: x, y, z> - make sure the swap in skill ID is in there. (You don’t have to give the swap in skill any Tags from yanflys Skill Learn plug-in).

Then repeat for bleeding edge y, changing the state ID to state y in the Custom Show Eval.

Then on the state x or y, add this tag in the note area:

<Custom Apply Effect>
if (user.isStateAffected(x)) {
user.removeState(y);
}
</Custom Apply Effect>
(or the x and y the other way around)

If this doesn’t do what you need it to do, I hope it at least points you in the right direction 😀
I have something very similar to this. Basically, on the skill you’d want to swap in (bleeding edge x and y), in the note area add this tag:

<Custom Show Eval>
visible = user.isStateAffected(x);
</Custom Show Eval>

Make sure your character can learn the swap in skill, in their class note area; if you’re using skill core you should have a tag that says <Learn Skill: x, y, z> - make sure the swap in skill ID is in there. (You don’t have to give the swap in skill any Tags from yanflys Skill Learn plug-in).

Then repeat for bleeding edge y, changing the state ID to state y in the Custom Show Eval.

Then on the state x or y, add this tag in the note area:

<Custom Apply Effect>
if (user.isStateAffected(x)) {
user.removeState(y);
}
</Custom Apply Effect>
(or the x and y the other way around)

If this doesn’t do what you need it to do, I hope it at least points you in the right direction 😀
This is very close! Although I think I should elaborate more.
These two states and the skills belong to a specific character, and her gimmick is using her HP to attack. So she has two skills, Blood Price (known previously as state X) and Soul Price (state Y), whose only purpose is to grant those states. If Soul Price is up, she can't put up Blood Price, and vice versa.

Spoiler: Explaining what the states do, optional read
Blood Price adds an HP cost to the next skill she uses, in exchange for a power boost, and Soul Price increases her next MP cost in exchange for healing based on damage dealt. The states both have notetags so that they automatically remove themselves after she deals damage with a skill, so that's already taken care of.
These states work on any skill/spell she gets, as long as it has an MP cost and deals damage.

Basically, Blood Price = Damage and Soul Price = Recovery.

Bleeding Edge can only be used under these states, and the effect changes depending on which is active. So when neither is active, you have the default that can't be used, but still appears so you can read the description. The Blood Price version is a nuke that saps more HP than a normal skill would under Blood Price, and the Soul Price version is a bigger heal than a normal skill would give under Soul Price. Since Blood Price and Soul Price can't be active at the same time, the Bleeding Edge skill changes to match whichever one is active, and then once you use the skill the state is removed and it returns to default. Then you have to manually apply either state again, rinse, repeat.

The problem I was having was that the default would disappear when Blood Price was up, but it wouldn't disappear when Soul Price was up, and I wanted it to disappear for both. Sorry, I know I sound needy, especially when you gave me such a good answer 🙁
Hm, on your default skill on your Custom Show Eval, what happens if you add:
user.HasSkill(y));
user.LearnSkill(y);

and then at the bottom, add:
visible = user.isStateAffected(y);

A complete shot in the dark, let me know if it works!
So pretty much doubling up on what you have at the moment, just doing it for both skill x & y and state x & y

Original thread: https://forums.rpgmakerweb.com/threads/skill-change-based-on-state.144619/