Help with states

Hi all,
I have RPG Maker MV for a little time and don't know too much of coding, so It would be great if someone helps me with some ideas for states because I don't know how to do them.
- A status that when faded (finishes at X turns) deals damage to affected actor.
- Same as before, but damage is dealt to all party and equals the damage recieved by the affected actor while the status was active.

Thanks 😉
Both of these effects will require plugins. Yanfly's Buffs & States Core can accomplish this.

http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/

For the first effect, a Custom Leave Effect (when the state disappears after duration ends) can do this:

<Custom Leave Effect>
var damage = damage amount;
user.gainHp(damage);
user.startDamagePopup();
user.clearResult();
</Custom Leave Effect>

Replace "damage amount" with the formula you want to damage them with. Remember these terms:

user: the battler with the state
origin: the battler who caused the state

As for the second effect, it's possible, but far more complicated. Right now, since you're still new at this, I wouldn't attempt it until you have more experience. The best thing for you right now is to practice with smaller stuff and work your way up to more complicated things. It's important to walk before you run.
Ok, will try that, thanks a lot!
And sry for my terminology xD

Original thread: https://forums.rpgmakerweb.com/threads/help-with-states.89660/