How can I transform skill used dependant on enemy state?

Im having trouble getting started and not sure if theres a plugin that will help me. I know Yanfly has AoE, passive states and I most likely need Moogle_X Elemental Booster.

So basically I want there to be 3 stacks of elements that each change dependant of what skill is being used.
-Each skill has an element which adds to stack.
-Maximum 3 stacks before reset.
-Skills transform effects in terms of damage or buffs.

Example:
Player casts Ice=Enemy gets frostbitten state (which is the Ice stack)
Player casts Ice->Ice(2 consecutive skills from Ice magic)= Enemy loses frostbite and gains chilled and the second Ice skill deals damage at 125%
Player casts Ice->Ice->Ice= Enemy loses chilled and becomes frozen, 3rd Ice skill deals damage at 125% value and increased crit chance by 10%.
Next cast of Ice restarts the stack from beginning.

Example 2:
Player casts Ice= Enemy has frostbite
Player casts Ice->Fire= Frostbite removed, Damage is reduced to 75% but deals the fire spell as AoE and changes fire attribute to Steam type of damage.
Next cast of Ice restarts the stack from beginning.
Here's the general idea. You would make your state: "Frostbitten" and add this code to it:

(You'll notice in this code I put a capital X. That is supposed to represent the MAX amount of frostbitten stacks you can have. Replace the X with whatever number you want)

<Custom Apply Effect>
var ice = target.getStateCounter(stateId);
if (ice != X){
target.addStateCounter(stateId, +1);}
</Custom Apply Effect>

<Custom Remove Effect>
// When removed, clear the stored heal value.
user.setStateCounter(stateId, 0);
// When removed, clear the number of charges on the state.
user.removeStateCounter(stateId);
</Custom Remove Effect>

Next, to make a skill require a stack of Frostbitten, you will need to use this code in the skill's note box:

(Here, you will replace X with the state ID of frostbitten. You will need to replace Y with the amount of stacks of frostbitten that are required to cast this particular spell.)

<Custom Requirement>
if (user.getStateCounter(X) >= Y ) {
value = true;
} else {
value = false;
}
</Custom Requirement>

(This code here reduces Frostbitten's stacks by Y amount...this should match the X and Y from the above code.)
<Custom Execution>
user.addStateCounter(X, -Y);
</Custom Execution>


To make a skill require TWO different kinds of stacks, you would use a code like this: (just replace X2 with the second state ID and Y2 with the amount of stacks you'd need to cast it)
<Custom Requirement>
if (user.getStateCounter(X) >= Y && user.getStateCounter(X2) >= Y2 ) {
value = true;
} else {
value = false;
}
</Custom Requirement>

<Custom Execution>
user.addStateCounter(X2, -Y2);
</Custom Execution>

If you want to show how many stacks of that particular state that a spell costs, you would use the following code:
(Replace X with the icon that you're using for that state/stack, and replace Y with the number of stacks you need to cast the spell.)
<Custom Cost Display>
\i[X] Y
</Custom Cost Display>
This is how it looks like in combat:
stacks.png


Now, you can add the Frostbitten/fire stacks however you want. I personally use Action Sequences to add a state/stack using the "add state X: user" tags. This can also be done using the skill common event feature, and just adding the state through the common event call itself. Hope this helps.


EDIT: ....so, I reread the thread, and you're looking to do something completely different than what I wrote here ROFL. Whelp...#RIP There are some things from here that you could still more-or-less use for what you're trying to do.
Here's the general idea. You would make your state: "Frostbitten" and add this code to it:



Next, to make a skill require a stack of Frostbitten, you will need to use this code in the skill's note box:

(Here, you will replace X with the state ID of frostbitten. You will need to replace Y with the amount of stacks of frostbitten that are required to cast this particular spell.)




To make a skill require TWO different kinds of stacks, you would use a code like this: (just replace X2 with the second state ID and Y2 with the amount of stacks you'd need to cast it)


If you want to show how many stacks of that particular state that a spell costs, you would use the following code:
(Replace X with the icon that you're using for that state/stack, and replace Y with the number of stacks you need to cast the spell.)

This is how it looks like in combat:
View attachment 91906

Now, you can add the Frostbitten/fire stacks however you want. I personally use Action Sequences to add a state/stack using the "add state X: user" tags. This can also be done using the skill common event feature, and just adding the state through the common event call itself. Hope this helps.


EDIT: ....so, I reread the thread, and you're looking to do something completely different than what I wrote here ROFL. Whelp...#RIP There are some things from here that you could still more-or-less use for what you're trying to do.

Haha lol thanks for the help, Yeah I simply put want to have each skill change effect depending on the last skill (element) used.
Some are as simple as increase/decrease the damage, some change or add states, some change the attack itself.

I found this plugin: Yanfly Skill Rewards
http://yanfly.moe/2017/11/03/yep-155-lunatic-pack-skill-rewards-rpg-maker-mv/

It can do what I need with tweaking, a few issues is that I need a state to the condition to check for the state on enemy, second the add state only adds state to character using skill.
If someone can help me with a plugin extension or code to make a condition check if the enemy has the state.
Edit: I figured out how to change states to add to target rather then user in the code.

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-transform-skill-used-dependant-on-enemy-state.96401/