MV Store equipped skill icon index in variable? (Javascript help needed!)

UPDATE: Thanks to Jragyn - working with the following...
$dataSkills[$gameParty.members()[0].battleSkillsRaw()[0]].iconIndex;

Color coded below
$dataSkills[$gameParty.members()[0].battleSkillsRaw()[0]].iconIndex;
0 = party member number 0-3, 0 is the part leader
0 = equipped skill number 0-X, 0 is the first skill

ORIGINAL POST:

I am using Yanfly's Equipped Battle Skills: http://www.yanfly.moe/wiki/Equip_Battle_Skills_(YEP)

I want to capture the icon index of an equipped battle skill in to a variable. This is so that I can reference the skill icon in TextEx using \I[\v[x]].

I am new to javascript, so I am not sure if my syntax is correct. The below is my attempt to capture the first equipped skill icon index of the first part member into a variable.

Can you tell me where I am wrong? Thanks in advance for help!

$skill($gameParty.members()[0].battleSkillsRaw()[1]).iconIndex
1615988577339.png
if you have access to the skill id (sounds like you do), then you can use:
Code:
// where SKILL_ID is the id of the skill you want the icon index for.
$dataSkills[SKILL_ID].iconIndex;
if you have access to the skill id (sounds like you do), then you can use:
Code:
// where SKILL_ID is the id of the skill you want the icon index for.
$dataSkills[SKILL_ID].iconIndex;

Can this work? I seem to get an error. (I am very new to JS, so likely a syntax problem)
$dataSkills[$gameParty.members()[0].battleSkillsRaw()[1]].iconIndex

I get a "Type error" when trying to insert the above in to a variable.
Oh, so it works? Excellent! I am glad your stuff is working-as-intended! :awink:

Original thread: https://forums.rpgmakerweb.com/threads/store-equipped-skill-icon-index-in-variable-javascript-help-needed.134505/