Need Help Making Skill That Nullifies Damage From Certain Skill Type

Hello, I need help adjusting a code I received and making it so that it nullifies Damage received from a certain skill type.
It's pretty self-explanatory, when the state is applied to the target, if the target takes damage from a certain skill type (skill type 1 in this example) it negates it (changes it's value to 0 and negates any status effects it would have applied). i'm actually unsure how to do the second part, so I could definitely use some help there.

Here's the code, any help?

Code:
<Custom React Effect>
// Check to see if the skill is a magical skill and deals positive HP damage.
if (this.isSkill() && this.item().stypeId==type_1() && this.isHpEffect() && value > 0) {
  value = 0
}
  target.startAnimation(58);
}
</Custom React Effect>

Original thread: https://forums.rpgmakerweb.com/threads/need-help-making-skill-that-nullifies-damage-from-certain-skill-type.173557/