Capture Action and Action Type

I am trying to figure out how the battle system works so I can hook into it, one thing I want to do is:

- Capture when the player does an action and

- Get the name of the action.

For example:
 player x casts fire on an enemy. or: player y uses potion

Where would I get this information?

It doesn't matter if the player does x, I just need to know about it directly AFTER the player does it and what it IS the player did.
Look in Game_Action.prototype.itemApply (I think it's called like that? Or is it applyItem? applyNormalAction? I forgot...) and in it is passed as a parameter who is the item/skill target, and you can get who is doing an action with this.subject(), and the actual item/skill he's doing with this.item()
During the execution of Game_Action.prototype.Apply(target):

this.subject() returns the subject of the action.

target holds the target (this happens once per target, if there are multiple targets).

this.item().name will give you the name of what the subject is doing.

Original thread: https://forums.rpgmakerweb.com/threads/capture-action-and-action-type.50159/