Help needed creating an ability (RMMV)

Hello.

I am making my first ever game and I have trouble creating an ability for my "hunter" class.

It is an ability called "bear trap" that targets the ally of your choice, and puts him/her under a "bear trap" state.
If the ally with the "bear trap" state is then attacked by an enemy, that enemy takes damage from of the "bear trap", which can cause bleeding.

Basically :
- put actor A under "bear trap" state
- if actor A is attacked by enemy X with physical attack :
- actor A gets damage normally
- enemy X gets damage from the bear trap (maybe 10% of its HP) and 50% chance bleeding
- "bear trap" state over

Is something like this possible ?

I hope I am posting in the right thread.
Thanks in advance.
I hope I am posting in the right thread.
Nope 😉

Moved to: VX Ace Support

Please confirm you ARE using VX Ace for this? Your post and title don't specify which engine. It's in your bio, but we regularly see people asking for help with engines that are different to what their bio says (even when they do only have one or two posts)
This is my first time posting here, sorry for the mistakes.

This is actually for MV, I am gonna change it in my bio and in the title of this thread.
Basically :
- put actor A under "bear trap" state
- if actor A is attacked by enemy X with physical attack :
- actor A gets damage normally
- enemy X gets damage from the bear trap (maybe 10% of its HP) and 50% chance bleeding
- "bear trap" state over

Is something like this possible ?
Certainty. I have similar effects in my game but they makes use of Yanfly's states and buffs plugin. going off of what you asked for and using that plugin, this notetag should work as a base for your beartrap state.

Code:
<Custom React Effect>
if (this.isDamage() && this.isForOpponent() && this.isPhysical()) {
  user.gainHp(-Math.ceil(user.mhp*.1));
  if (Math.random() < 0.5) user.addState(bleed state ID goes here);
  if (user.isDead()) user.performCollapse();
  target.removeState(stateId);
}
</Custom React Effect>
Thanks for the quick answer. I will try to apply this.

Edit : It works as intended. Thanks for the help !
Moved back to MV support due to OP clarification. Also, looks solved so...closing. If you need the thread later, you can report to have to reopened. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/help-needed-creating-an-ability-rmmv.157652/