OK... I've been tinkering in my editor and I think I have something that will work. You'll need the following two scripts:
Tsukihime's Common Event Variables.
Yanfly's Element Absorb.
So first things first - you'll need 8 enemies in your database (unless you know of another way to change the enemy graphic other than "enemy transform"). Let's say, FadedNull, FadedRed, FadedGreen, FadedPurple, FadedYellow, FadedBlue, FadedOrange, and FadedShattered. They all have their respective graphics. For the 6 color Fadeds, tag them using Yanfly's Element Absorb script to absorb their corresponding elements - so FadedRed, if he absorbs fire (which is, by default, element number 3), would be "<element absorb: 3>". Then give each of them their respective skills.
Picture example:
Next, we'll need some states. We'll have Null, Red, Green, Purple, Yellow, Blue, Orange, and Shattered for this example. Null will reduce all the color damage to 0%. Every other state will simply decrease damage taken by its same element by however much you want to absorb. In Yanfly's state, the less damage it's set to take, the more it will absorb. So, if FadedRed has the Red state, and the Red state has set "Fire*50%", then FadedRed will absorb 150% of all fire damage done to it. You'll also want a stun state that lasts for 2 turns - set it to "cannot move," and "turn end 2~2." This is because the turn it's inflicted counts as 1 turn, so it will effectively lose its ability to act on the next turn. Lastly, you'll want a shattered state, that sets PDR and MDR to 125% and ATK and MAT to 75% (this will increase damage taken by 25% and lower offenses by 25%).
Here's where the legwork starts to come in - for every skill that does some kind of elemental damage, you'll want to add the following into the damage formula:
c=(damage formula);if b.state?(x);c*=1.5;b.add_state(y);end;if c>=((b.hp*1.0)*0.3);v[z]=1;end;cThere's a lot of variables in there, so let me break it down for a moment - X is going to be the opposite state to the skill's element. So let's say you're working with a red element skill - x will be the Green state. Y is going to be whatever state your stun is. I'm assuming the damage formula won't be more complicated than about 20 characters or so (maybe something like "a.mat*4-b.mdf*2"). If it is, then we can move this damage formula into a script call as part of the common event. So the first part of that statement is saying, "If the target has the opposite element's state, then multiply the damage by 1.5 and stun him."
So now we know how much damage the ability is going to do, thanks to calculating c. So now we want to see if c is greater than or equal to 30% of the Faded's remaining HP (if you want it to be 30% of the Faded's MAXIMUM HP, instead of its current HP, just change "b.hp" to "b.mhp"). If it is, we're going to set a variable (Z - whatever variable you happen to have available) equal to 1. Then we close out the end statement and make the ability do damage by putting c.
So let's say you're writing the damage formula for a red skill, the Green state is 5, the stun state is 10, your ability does a.mat-b.mdf damage, and you're going to store variable 23: Shatter. Then your formula would look like this:
c=a.mat-b.mdf;if b.state?(5);c*=1.5;b.add_state(10);end;if c>=((b.hp*1.0)*0.3);v[23]=1;end;cBut we're not done yet, so let's call a common event - one for each of the colors. In this example, we'll call common event Red.
We'll just be doing a script call within it that will look like this:
b = $game_temp.common_event_targetif b.state?(x); b.remove_state(x)b.add_state(y)else if b.state?(z)if $game_variables[sh]==1b.remove_state(z)b.add_state(s)$game_variables[sh]=0elseend; end; endThe common_event_target bit is from Tsukihime's common event variables script. It will basically store the ID of whoever you targeted the skill with. For this common event, X is going to be your null state, Y is going to be your "affinity" state, Z is going to be your "opposite" state, S is going to be the shattered state, and SH is the number of the variable you assigned in that damage formula earlier.
So what this is doing is saying, "If the target has the Null state, remove it, and add the state corresponding to the color I just used." If it doesn't have null, it says, "If the target has the opposite state of the color I just used, then is my stored variable equal to 1? If it is (which means you did at least 30% of the target's health with your attack), remove its current color state, add the shattered state, and set my variable back to 0."
So let's use our earlier example again - let's say you have a Red skill. Let's say the Null state is state 2, the Red state is state 3, Green is state 5, Shattered is state 11, and 23 is the variable you used to store whether or not you did at least 30% of the target's HP. Your call would look like this:
b = $game_temp.common_event_targetif b.state?(2); b.remove_state(2)b.add_state(3)else if b.state?(5)if $game_variables[23]==1b.remove_state(5)b.add_state(11)$game_variables[23]=0elseend; end; endThen create the other 5 common events for each color in the same way.
Pictures of the skill and common event for reference:
Now we need to figure out how to make the FadedColor randomly lose its color status whenever it uses one of its color skills. So, for each of the FadedColor's abilities, we'll call a common event corresponding to its color.
Set a variable (let's say variable 2: Random) to a random number between 1 and 100. Then make the following script call:
a = $game_temp.common_event_userif $game_variables[2]<=35a.remove_state(x)a.add_state(y)endX is the corresponding color's state and Y is the null state. So, let's say we're making a Wind skill for a FadedGreen, where Green is state 5, and Null is state 2. Your "FadedGreen" common event would look like this:
a = $game_temp.common_event_userif $game_variables[2]<=35a.remove_state(5)a.add_state(2)endPicture example:
There's one last bit, and I will admit, I think my solution here is perhaps not the best one available. If there's a way to make enemies transform via a script call, it would probably be more effective than what I'm about to suggest. So hopefully someone can chime in with that.
Anyway, on the troop page for your Faded troop, make a page that, at the beginning of the battle, adds the state "Null" to each Faded. So, Turn 0, span Battle, "Change enemy state: Null."
Now make one more page, set to the condition "When the end of the turn," and span: "Turn." For each Faded enemy, make the following string of conditionals:
Conditional: Faded is Red inflicted
Enemy transform: FadedRed
Else:
Conditional: Faded is Green inflicted
Enemy transform: FadedGreen
Else:
Conditional: Faded is Blue inflicted
Enemy transform: FadedBlue
And so on for each color, as well as one for if the shattered state is inflicted (enemy transform: FadedShattered) and is null inflicted (enemy transform: FadedNull).
What this will do is, at the end of each turn, change the enemy's graphic to match its corresponding state (as well as give it the corresponding abilities). If you're OK with that, then cool - if you'd like the graphic transformation to be more instantaneous, you'll need it to be part of the script call when you use a damaging ability against them, but alas, I don't know the solution for that one. You could potentially do some troop events using the "moment" span and some additional conditionals using Tsukihime's Custom Page Condition script (that Zoltor linked), too.
Picture for example:
Also, I made a video to sample all of the behavior and make sure that this is what you're looking for: