Respond effect to target own mana

Can someone correct whatever I'm doing wrong in this short code snippet?


<Custom Respond Effect>


If (value >= target.mp)  {


target.mp == 15;


}


<\Custom Respond Effect>


this is on a passive state. I tried switching to user instead of target, but since it's a respond effect to being damaged the person with the state is the target. Did I screw up my equal signs or  parentheses or something?
I'm not sure if you mean target.mp == 15, as all that is doing is seeing if the mp is 15, and if so returning true. Do you want to make the mp always 15 in this case? Or do you want to remove 15 MP? If the latter, try this in your custom respond effect.


value = -15;


target.gainMp(value);
I actually want to set it to exactly 15 if that state is on and they are hit for more damage than they have mana. 


Imagine a target charged with mana. They are brimming full of energy. They get struck, if the attack is to powerful, (more than their mana) then they unleash it in a sudden devastating burst, that causes significant damage to all and leaves the character with 15 MP, one less than the cost of the characters heal ability. 
Hmmm...to do that then you'll have to store the difference between the target's MP and 15 in value, then remove that much MP. That's the only way to do it, as I don't think you can set mp directly via the code there, only add to and remove from it. Try:


value = target.Mp - 15;


target.gainMp(-value);


However, on another note, you do realize that if the target has < 15 this skill will still set their MP 15, meaning they will gain MP? You might be able to fix it with a use of a command to set the minimum of value to be 0 (so it can't go negative on you, which it will if MP < 15), but I don't know that command off the top of my head.
Value always call the damage done? In this case you may want to use === instead of ==.

Original thread: https://forums.rpgmakerweb.com/threads/respond-effect-to-target-own-mana.61451/