Custom State/status ailment questions - Is a plug in needed or can I do this as is?

My game involves the use of several status ailments. A lot of RPG staples like Poison, Confusion, etc. But there are two particular Status Aliments I want to implement that are important to the story, world and themes of the game that I'm not entirely sure how to go about setting up.

The first and simpler (I assume) of these is "Mana Poisoning". The effect is a poison-like drain on MP, Unless there's 0 MP. In which case, it will drain HP at an accelerated rate.
My issue is that I can't figure out how to make that condition. I can set an MP and HP drain trait on the state. But I don't know how to make it so that it switches over to HP Drain if MP is empty. Is this too complex to be done in base MV? Or am I missing something hilariously obvious?

The second one is more complex due to the amount of steps involved. I'll try to explain as clearly as I can.
First, I want to make it so actors always drop to 1 HP before knockout. Giving the player a chance to recover. (There might be attacks that ignore this. We'll figure that out.)
Say an actor has 98 HP and they get hit with an attack that deals 100? They don't get knocked out. But are reduced to 1 HP.
I'm calling this state "Wounded".
Secondly, I want this state to be applicable to certain enemy types as well. But not all. The reason being that there's a couple party members who have issues with killing people.
So when an enemy is in the "Wounded" state, I want to make it so these two actors can't attack them. (I promise the story justifies this.)

My questions are as follows:
Does anyone know how I would go about this?
Can I do it with states or events somehow?
Do I need a plug in?
Is any of this even possible? and if not, Does anyone know what the closest solution is?

Thank you to anybody reading. If you've got advice, I'm all ears.
both can be done with yanfly's buffs and states plugin, although the second one would probably want to be a passive state via the auto passive states plugin. both will require a little javascript

The first and simpler (I assume) of these is "Mana Poisoning". The effect is a poison-like drain on MP, Unless there's 0 MP. In which case, it will drain HP at an accelerated rate.

for the poison state, the notetag would be something like this:
Code:
<Custom Regenerate Effect>
var rate = .1;
if (user.mp > 0)
  user.gainMp(Math.ceil(-user.mmp*rate))
else
  user.gainHp(Math.ceil(-user.mhp*rate*2))
</Custom Regenerate Effect>
change "rate" as needed.
right now itll drain 10% of the target's max mp and if they have none, itll take 20% of their max hp instead.


The second one is more complex due to the amount of steps involved.
...
So when an enemy is in the "Wounded" state, I want to make it so these two actors can't attack them. (I promise the story justifies this.)
Up until having the two party members not attack wounded enemies, it was a pretty simple one, but even with the target restriction its doable. not going to write it out until i confirm what you want though. any time the target takes lethal damage, theyre to live with 1hp first, and the only truly lethal damage is damage they take at 1hp? or do they survive the first lethal hit per battle?
do you this wounded state to only show when the target is at 1hp? or does it get removed as they are healed / disappear over time?
For the "Wounded" status ailment, the best workaround I can think of is to use a battle event in the Troops section. For example, you can set up a conditional branch where, if the "Wounded" state is applied to Enemy #1, you also give that enemy a hidden state called "No Instant Death." This hidden state would have a trait that resists the knockout state, preventing instant death.

This method also allows you to make the "Wounded" state applicable only to specific enemy types. To remove the "Wounded" state, you can add another conditional branch that removes both "Wounded" and "No Instant Death" when that enemy's HP drops to 1.
both can be done with yanfly's buffs and states plugin, although the second one would probably want to be a passive state via the auto passive states plugin. both will require a little javascript



for the poison state, the notetag would be something like this:
Code:
<Custom Regenerate Effect>
var rate = .1;
if (user.mp > 0)
  user.gainMp(Math.ceil(-user.mmp*rate))
else
  user.gainHp(Math.ceil(-user.mhp*rate*2))
</Custom Regenerate Effect>
change "rate" as needed.
right now itll drain 10% of the target's max mp and if they have none, itll take 20% of their max hp instead.



Up until having the two party members not attack wounded enemies, it was a pretty simple one, but even with the target restriction its doable. not going to write it out until i confirm what you want though. any time the target takes lethal damage, theyre to live with 1hp first, and the only truly lethal damage is damage they take at 1hp? or do they survive the first lethal hit per battle?
do you this wounded state to only show when the target is at 1hp? or does it get removed as they are healed / disappear over time?
Thanks for the help with the Mana Poison! The only thing I can't figure out with that is if it's possible to have MP "Slip Damage" outside of battle. I read over the Plugin but couldn't quite find an answer. If this is not possible, that's fine.I can design the game around that. But If it is possible to have the effects of the state apply outside battle, then I can use that in dungeon design.

On the subject of the Wounded State:
You've got the first part right. When taking lethal damage, the actor or specific enemy type lives with 1HP. The only true Lethal Damage would be when the actor or enemy is at 1HP.
The wounded state would only show up at 1HP. It's mainly a way of notifying the player they need to heal NOW. So it would vanish when healed.
To be honest, I don't know if this needs to be a state or not. But I can't quite figure out how else to implement the concept.
For the "Wounded" status ailment, the best workaround I can think of is to use a battle event in the Troops section. For example, you can set up a conditional branch where, if the "Wounded" state is applied to Enemy #1, you also give that enemy a hidden state called "No Instant Death." This hidden state would have a trait that resists the knockout state, preventing instant death.

This method also allows you to make the "Wounded" state applicable only to specific enemy types. To remove the "Wounded" state, you can add another conditional branch that removes both "Wounded" and "No Instant Death" when that enemy's HP drops to 1.
I will keep this method in mind. It could work.
Sorry for the long delay in responses. I don't always have the time to work on my game. But I appreciate any help!

I think it might be helpful for me to go over what I'm trying to accomplish with the "wounded" concept. Because for all I know, a State isn't what I'm looking for.

The idea of the player being able to survive lethal hits and recover kind of came about as a side effect of the core concept. Which was suggested to me by one of my friends working on the game with me.
Two of the party members are pacifistic in the beginning and won't kill people. (Monster and Beasts are fine. But not people.). Whereas the other party members are warriors and killers.
My friend wondered if it would be possible to represent this in the gameplay by having these two characters unable to finish off the "human" enemies during battle.
Eventually, one of these two characters becomes able to kill due to story events.
I almost wonder if it would be possible to attach the inability to kill to the actors or classes themselves.
I also feel that it would make sense for some Wounded Enemies to be able to flee battle. But I should probably take this one step at a time. Determine if this is even possible.

to sum up what I'm looking to do: I want to make it so certain characters are able to fight but unable to kill certain enemy types.

Original thread: https://forums.rpgmakerweb.com/threads/custom-state-status-ailment-questions-is-a-plug-in-needed-or-can-i-do-this-as-is.174708/