Error - Help!

I’m getting an error and I can’t figure out why.

This is the error, which shows up when I try to access my stat screen:
{message:"Result of expression \‘variable.toLowerCase\’ [undefined] is not a function. ",line:543,sourceId:354648424,sourceURL: “file:///Users/Sienna/Desktop/GAME/scene.js”,expressionBeginOffset: 17252,expressionCaretOffset:17272,expressionEndOffset:17274,name:“TypeError”}

This is the code for the stat screen. And yes, I’ve set the variable charm in mygame.js. It equals 5.
*temp skill
*set skill 0
*if (charm > 0)
*set skill {charm}
*gosub skill_level

*label skill_level
*if (skill > 0) and (skill < 10)
*if (skill >= 10) and (skill < 20)
*if (skill >= 20) and (skill < 30)
*if (skill >= 30) and (skill < 40)
*if (skill >= 40) and (skill < 50)
*if (skill >= 50) and (skill < 60)
*if (skill >= 60) and (skill < 70)
*if (skill >= 70) and (skill < 80)
*if (skill >= 80) and (skill < 90)
*if (skill >= 90) and (skill < 100)
*if (skill = 100)

Help please!

Line 4, “{charm}” I do not think the {} are supposed to be there.

(A bit more difficult to find the error when it points you to a .js file, isn’t it?)

'Cause in the example in the advanced help files (example below):
*set honesty 30 *set virtue "honesty" *set score {virtue} Your ${virtue} score is ${score}
The curly parenthesis are to set “score” to the value of “honesty”.
So: line four of that example could be written as:
*set score honesty
without changing the output. (It would change the nature of the four lines, but that is a separate matter.)

Which, assuming I’m correct in my guesses, that means “*set skill {charm}” isn’t like writing “*set skill #”. I think the error is that it ends up treating the # as a variable when you type {charm} with charm equaling a number, and therefore tries to pull out what the variable has been set to.

I was just about to post that I had figured out the problem came from that line, but didn’t know why… thanks for helping, that worked.

So I guess the {} are specifically for ref variables then? Like if I said:
*set skill “charm”
then I could say:
*set skill_value {skill}
which would make skill_value = charm? With no errors?