MV Adding Turns Yanfly States/Buffs With Formula?

I would like my skill to do the equivalent of:

<State MyState Turns: +x>

where x = a.mat * 4 - b.mdf + b.luk

I'm simply confused about the exact syntax after reading about all the different note tags 100 times.

Do I want to use <Custom State name Turn> or <Custom Apply Effect>?

I have seen a few different methods of referencing the caster and target in various Tips & Tricks examples. Which ones do I need in this case?
Moved to: Plugin Support
Solved it. Turns out the reason none of my previous attempts were working was down to a missing "s" typo in the documentation, as mentioned in this thread.

In case anyone else is looking to do this, the solution for the example in the OP was just:

<Custom State MyState Turns> turn += a.mat * 4 - b.mdf + b.luk; </Custom State MyState Turns>

If you paste that in your skill notetag, it will add turns to the state based on the results in the formula.

Again, be careful when copying from Yanfly's documentation here, as it incorrectly states <Custom State X Turn> with a singular "turn". You need to use plural <Custom State X Turns> or it won't work.

Original thread: https://forums.rpgmakerweb.com/threads/adding-turns-yanfly-states-buffs-with-formula.138916/