how did you define the array?
My assumption is that your game variable array isnt actually giving the value you think it is. that equipState property belongs to skills, so that error says that something is expecting to be provided a skill from which it gets that property, but it isnt getting it cause the skill doesnt esist. if that array gives a 0, skill 0 is null and it wouldnt have an equipState property
What is in Game Variable 15? Unless something else is going on, it looks like the function is only expecting the Skill's ID so if you have anything other than that in the array, it could cause an issue:
$gameVariables.setValue(15,[$gameParty.leader().battleSkillsRaw()]);
battleSkillsRaw - This returns an array of the skills in their ID form that the actor has
equipped currently.
It works just fine, i wrote a message that gives me an array of ID`s in right order: 220,221,222,223, 224,158,233,89.
So there is nothing else but skill ID`S in the array, and it's not equal 0.
EDIT:
Just wanna say that i'm completely newbie in JS