MZ Pull Icon Index of last used Skill

Hey ya'll

I am having a major brain fart.

How do I pull the iconIndex # of the last used skill (skill selected)?

I swear I had a version of it working at one point for my projectiles but can't remember it at all now.
Maybe:

$dataSkills[$gameTemp.lastActionData(0)]?.iconIndex ?? 0
It depends on the exact timing.
It depends on the exact timing.
Running in a Custom Action Sequence, so this SHOULD do it. I'll give it a go.


UPDATE:

Yep that was it. Thanks @caethyril , this can be closed out
Great! Happy RPG Making~

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/pull-icon-index-of-last-used-skill.163795/