Find Skill Type of Game Action via Script

Looking for a way to determine what skill type an action is while running a script.

I'm using Yanfly's plugins and specifically following his tips & tricks guide for Dualcasting. It seems to be able to act on only 'magical' skills. I see this is a method of the Game_Action class:

if (action && action.isSkill() && action.isMagical()) {
...
}

However, looking through the library, I haven't been able to find a method that can fetch the skill type. Essentially, I want to change the action.isMagical() to check if the action is a skill of type X. Any ideas?
Hello.
this.item().stypeId will return the skill type id of the action.
if (action.item().stypeId === 1) //check if the skill is magic (assuming magic is the first skill type in the database)
Hello.
this.item().stypeId will return the skill type id of the action.
if (action.item().stypeId === 1) //check if the skill is magic (assuming magic is the first skill type in the database)
Yes, that worked exactly. I'm not sure why though. I see Game_Item in the library, but it has no member stypeId. I think I'm fundamentally missing something about the hierarchy.

Also, thank you!
Yes, that worked exactly. I'm not sure why though. I see Game_Item in the library, but it has no member stypeId. I think I'm fundamentally missing something about the hierarchy.

Also, thank you!
Game_Item is the class that holds the skills and items that actors/enemies use, but they are not the *data* of those skills and items. The item() function returns an element from the $dataSkills array, which is what contains the actual information of the skill, and is loaded from Skills.json. If you look up my primer post on data class mapping, it explains exactly what internal variables map to the different aspects of the database.

stypeId is the variable that maps to the "skill type" dropdown in the skills tab.
Game_Item is the class that holds the skills and items that actors/enemies use, but they are not the *data* of those skills and items. The item() function returns an element from the $dataSkills array, which is what contains the actual information of the skill, and is loaded from Skills.json. If you look up my primer post on data class mapping, it explains exactly what internal variables map to the different aspects of the database.

stypeId is the variable that maps to the "skill type" dropdown in the skills tab.
Thanks for going the extra mile and explaining. I think I'll be able to extrapolate this to solve a lot of other issues in future.
Thanks for going the extra mile and explaining. I think I'll be able to extrapolate this to solve a lot of other issues in future.
Here's the post in question just in case it's useful to you. https://forums.rpgmakerweb.com/index.php?threads/a-primer-on-data-class-mapping.137348/

Original thread: https://forums.rpgmakerweb.com/threads/find-skill-type-of-game-action-via-script.144395/