[Solved]How to adjust damage value

I want to use below codes to adjust damage value, but it not work, so how to make this work? 😢

Code:
<Custom Respond Effect>
if (target.isAlive() && value>(target.mhp%0.1)) {
value = target.mhp%0.1;
}
</Custom Respond Effect>
Moved to: Learning Javascript
so how to make this work
first, notetags by themselves have absolutely no function.
to do anything there has to be a plugin that reads the notetags and to react to them.

so you'll have to give us a link to the plugins you're using to read those notetags, because otherwise we can only guess what that does.

second, if you want to learn javascript to use in the damage formula and in eval-type notetags, then you need to tell us not only a code snippet but also what that code snippet is supposed to do.
In the case of your code, the modulo-part of that code is rather strange - unless there is something else handling the "value", that would always result in value = 0 for anything in regular game mechanics.
first, notetags by themselves have absolutely no function.
to do anything there has to be a plugin that reads the notetags and to react to them.

so you'll have to give us a link to the plugins you're using to read those notetags, because otherwise we can only guess what that does.

second, if you want to learn javascript to use in the damage formula and in eval-type notetags, then you need to tell us not only a code snippet but also what that code snippet is supposed to do.
In the case of your code, the modulo-part of that code is rather strange - unless there is something else handling the "value", that would always result in value = 0 for anything in regular game mechanics.
Thanks for reply, I use BUFFS&States Core in Yanfly Engine Plugins, http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
and I want to use below function to create a passive status that max damage dealt to the battler will reduce to battler's 0.1 * maxhp.
Code:
<Custom Respond Effect>
code
code
</Custom Respond Effect>
This effect will run when the battler is selected as a target. This will occur only if the action connects and will occur after damage execution. This effect will run after damage calculation occurs. The ‘value’ variable is equal to the damage dealt to the battler. This is the first effect to run after damage execution has taken place.
First:

If you want to get 10% or any percent of a value, you need to use the multiplication operator not the % because that is the modulo operator..

So your check and your value should be

targetHP*0.10

not targetHP%0.10

Second:

Respond effect happens after the damage is dealt (as written in the note after the tag you posted),

"This will occur only if the action connects and will occur after damage execution"

so if your goal is to minimize/modify the damage, you should use a different notetag. I think "react" is the right notetag for this
First:

If you want to get 10% or any percent of a value, you need to use the multiplication operator not the % because that is the modulo operator..

So your check and your value should be

targetHP*0.10

not targetHP%0.10

Second:

Respond effect happens after the damage is dealt (as written in the note after the tag you posted),

"This will occur only if the action connects and will occur after damage execution"

so if your goal is to minimize/modify the damage, you should use a different notetag. I think "react" is the right notetag for this
Thank you very much 🙂 'react' notetag is exactly what i want.

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/solved-how-to-adjust-damage-value.108590/