Damage based on turns left on state?

I'm trying to create a state that increases damage done by a certain element depending on how many turns remaining on the state. So for example, if the target has 3 turns left on this state then it would take 15% more damage from element 4 (fire). It would then go down to 10% the next turn, and then 5% the turn after that. Basically increases Element Rate of Fire (aka 4) by 5% per number of turns left on the state. I am using Yanfly's BuffsStatesCore and most of his other plugins really. Thanks.

State: "Burning" - Increases Element Rate: Fire (4) by 5% per turn remaining.
Ok, I did some research and came up w/ the following so far, but it's clearly missing something or has the wrong syntax:

<Custom Apply Effect>
target.elementRate(4) += target.stateTurns(121) * 0.1;
</Custom Apply Effect>

<Custom Regenerate Effect>
target.elementRate(4) -= 0.1;
</Custom Regenerate Effect>

(The state also inflicts DoT, but I removed it for now for the sake of staying on topic.)
Bump...

If anyone can be so kind as to tell me if "target.elementRate()" & "target.stateTurns()" are valid terms, I'd be able to tinker the rest from there. Or any alternatives would be just was helpful, thx.

Original thread: https://forums.rpgmakerweb.com/threads/damage-based-on-turns-left-on-state.102619/