Learning support Blue magic.

Hi there.
I've recently been tinkering with the idea of blue magic in my project and was wondering if there is anyway to get enemies to hit you with support spells(I.e mighty guard, white wind) when they're confused for example. I'm unfortunately not that well versed in JS coding so don't really have any idea how to tell the game to do it and was looking for any pointers or advice.
I worked around this issue in a different way. I dropped the traditional requirement that a spell has to hit you and just made it so that the character has to witness the spell being used. If an enemy casts a support spell on themselves, that's enough to learn it if the actor is capable of such. I wasn't able to do this with Yanfly's implementation as it keys off of the actor when hit with a Skill so I wrote my own plugin for it. You can find it here if you're interested.

https://forums.rpgmakerweb.com/index.php?threads/frog-blue-magic.88501/
That absolutely fantastic thank you so much.

Original thread: https://forums.rpgmakerweb.com/threads/learning-support-blue-magic.93780/