Damage / heal over time based on turns remaining

Is there a way for a state to do damage based on how many turns it has remaining? For example, I'd like to have a damage/heal over time do 400 damage when the there are 4 turns left, 300 when there are 3 turns left, 200 when there are 2 turns left, etc.

I'm currently using Yanfly's Buffs and States as well as Extended Damage over Time but I haven't found any syntax that can return the number of turns on a state ID that can be used in a damage formula.

Thanks in advance for any assistance!
If you don't get an affirmative response on this one using Yanfly's plugins, there is a "Progressive States" plug in (I forgot who made it..) that you could use. You would just need 4 states to accomplish this.

State 400 - heals for 400HP, progresses into State 300.
State 300 - heals for 300HP, progresses into State 200.. etc.

Best,
MIA 🙂
I think i can help you. However, i haven't tested this so i cannot guarantee that it will work properly.

Spoiler
<Custom Apply Effect>
//Setup a flag to remember target's turn. Remember to set your turns to remove this state in your Database equal to this number. If you want to reset turn counter when this state is applied, just remove target._turnCounter ||
target._turnCounter = target._turnCounter || 4;
</Custom Apply Effect>


<Custom Regenerate Effect>
//Check if target's turn is higher than 0
if (target._turnCounter > 0){
//Get the amount of HP recovered
var heal = target._turnCounter * 100;
//Heal target
target.gainHp(heal);
//Decrease target's turns by 1
target._turnCounter -= 1;}
</Custom Regenerate Effect>

<Custom Remove Effect>

//Remove target's turn counter when the state is gone.
target._turnCounter = undefined;
</Custome Remove Effect>
@JamesRyan That works perfectly as intended. Thanks so much for your time.

Unfortunately I am getting a conflict with another plugin during the Custom Remove Effect and I just don't understand well enough to get around it. I'm thinking through some workarounds now, thanks again!
The <Custom Remove Effect> part is important, so you should do something with this incompatibility (even get rid of the plugin causing it if there is no other choices).

Original thread: https://forums.rpgmakerweb.com/threads/damage-heal-over-time-based-on-turns-remaining.78875/