(Yanfly Skill Core) Removing HP cost of skills ONLY for enemies?

In my game, many skills cost a percentage of HP rather than MP. However, this has created an issue where bosses will drain their own health very quickly with only a couple skills. Right now, my solution has been to make a duplicate of every skill, one that costs HP (for the player), and one that doesn't (enemy). However, I feel that there may be an easier solution (maybe a script change or tag?). Could anyone help me on this?
I think it would help if you send a screenshot of your skill in the database and also his note tags.
An example:
database1.png
database2.png


To clarify, what I mean is: is there a way to eliminate the HP cost of the Trisect skill for enemies only without having to make a duplicate?
Hi!
I'm not really experienced in using yanfly plugins. But I believe you have to use the custom code note tag:
<Custom HP Cost>
code here
</Custom HP Cost>
Then inside the code, you can use something to identify the user and target.
Like, if(this.subsject() === actor){
// do the hp cost
}

So this way, it will only cost the hp if the user is an actor.
But I don't really know what is the code to find that. I don't know if it is 'user' or 'this.subject()' etc...
Guess you have to find that out or wait for someone that really knows for sure about that.
@Eliaquim Thanks! I'll play around with that, see what I can do. And yes, if anyone else knows, it'd be a great help!
I looked through the documentation, and @Eliaquim has the right idea. There's no built-in way to modify the HP cost of a skill per-character, like there is with mp cost rate.

Your best bet is probably something like
Code:
<Custom HP Cost>
  if (user.isEnemy()) cost = 0;
  else cost = whateverTheCostShouldBe;
</Custom HP Cost>
Just gonna offer a good design tip in general: Don't have your enemy skills be the same as your actor skills, even if if you want both enemies and actors to be able to cast, say "Firaga" or "Meteor." This way, you can tweak one for actors, and another (with different costs, perhaps no cooldown, etc) for enemies. Should the need arise, it also lets you buff an actor skill without also unintentionally buffing it for the enemies as well.
@Doktor_Q I'll use this for some skills, but unfortunately it doesn't look like there's a way to set a percentage of max HP as the cost. But thanks anyway!

@Aesica Thanks for the tip. I have to do this for some skills, however, because there is a blue mage in my game.
Depending on how you have blue magic implemented, there's nothing that says the skill used by the enemy has to be the same skill learned by the player. One of my blue magic skills in particular, Counterspell, is learned by eating the counterattack.
Moved to: Plugin Support

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-core-removing-hp-cost-of-skills-only-for-enemies.124252/