MV Help with Lunatic Mode for YEP Buff & State Core

Hey everyone, me again!

I am trying to use YEP Buff & State Core to create a state that deals damage each turn to the effected battler based on the number of turns left on the state. To be exact, I want it to deal 10% of the effected battler's max hp as damage per turn left on the state. So if the battler has 3 stacks of this state, they will take 30% of their max hp as damage at the start of their turn. I tried hobbling it together but couldn't get it to actually deal damage, I'm guessing I don't know how to reference the number of turns left correctly.

Thanks!
I tried hobbling it together but couldn't get it to actually deal damage, I'm guessing I don't know how to reference the number of turns left correctly.
how had you tried to do it before? it could have been a typo. the base engine has a _stateTurns array property that holds the current state durations and yanfly added a getter function to it in that plugin. try
Code:
<Custom Turn Start Effect>
user.gainHp(-Math.ceil(user.mhp/10*user.stateTurns(stateId)))
</Custom Turn Start Effect>
This thread was moved from RPG Maker MV Support to JavaScript/Plugin Support.
how had you tried to do it before? it could have been a typo. the base engine has a _stateTurns array property that holds the current state durations and yanfly added a getter function to it in that plugin. try
Code:
<Custom Turn Start Effect>
user.gainHp(-Math.ceil(user.mhp/10*user.stateTurns(stateId)))
</Custom Turn Start Effect>

This unfortunately doesn't seem to work, I'm wondering if maybe I need to move the plugin around in my plugins list but won't have time to mess with it today. I appreciate the attempt, it really looks like it should do it!
YEP plugins are know to have a more strict order.

check his website or use the plugin in my spoiler (ALOE_YEP_PluginOrderChecker)
to see which one is wrong and the correct order from the plugin you currently use.
YEP plugins are know to have a more strict order.

check his website or use the plugin in my spoiler (ALOE_YEP_PluginOrderChecker)
to see which one is wrong and the correct order from the plugin you currently use.

I did have some plugins out of order but unfortunately fixing it did not make this custom start effect work.

how had you tried to do it before? it could have been a typo. the base engine has a _stateTurns array property that holds the current state durations and yanfly added a getter function to it in that plugin. try
Code:
<Custom Turn Start Effect>
user.gainHp(-Math.ceil(user.mhp/10*user.stateTurns(stateId)))
</Custom Turn Start Effect>

Is it possible that "user" doesn't refer to the afflicted character?

EDIT: Got it working as Custom Regenerate Effect. Not sure why the Turn Start doesn't work but I'll take it!
EDIT: Got it working as Custom Regenerate Effect. Not sure why the Turn Start doesn't work but I'll take it!
if was on an enemy then try this. The damage may have been dealt but there just might not have been a damage popup to show it.

Code:
<Custom Turn Start Effect>
user.gainHp(-Math.ceil(user.mhp/10*user.stateTurns(stateId)))
user.startDamagePopup()
</Custom Turn Start Effect>

If it was an enemy then itd be harder to notice a health change without an hp gauge plugin
if was on an enemy then try this. The damage may have been dealt but there just might not have been a damage popup to show it.

Code:
<Custom Turn Start Effect>
user.gainHp(-Math.ceil(user.mhp/10*user.stateTurns(stateId)))
user.startDamagePopup()
</Custom Turn Start Effect>

If it was an enemy then its be harder to notice a health change without an hp gauge plugin

That did it! I had no idea it wouldn't draw the damage popup by default whenever health changed lol. Thanks so much, now it is working as intended!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-lunatic-mode-for-yep-buff-state-core.177583/