Formula help: Battle action exp

Good morning!

I'm trying to set up this plugin:
http://himeworks.com/2016/02/battle-action-exp/

For some reason, actors gain exp no matter who is using a skill. So if an Enemy attacks an actor, the actor still gets exp.
I need to set it up in a way so that exp is only granted when an actor uses an attack.

I tried this: a.isActor() ? [formula] : 0

But this doesn't work. Any idea?

Best regards!
Code:
b.isEnemy() ? (b.result().hpDamage / b.mhp) * b.exp() : 0
b.isEnemy() ? (b.result().hpDamage / b.mhp) * b.exp() : 0

This doesn't work when you're using a skill that has an actor as a target (e.g. healing skills)
This doesn't work when you're using a skill that has an actor as a target (e.g. healing skills)
If you want it affect on actor too then it should be like this:
Code:
b.isEnemy() ? (b.result().hpDamage / b.mhp) * b.exp() : b.currentExp() * 0.2
so if you cast anything on an ally you will receive 20% of his current Exp

I've moved this thread to Plugin Support. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/formula-help-battle-action-exp.103488/