If I understand correctly what you are trying to do - then you need to pull that value from the character cache. Like GetFinalCacheValue or such (sorry, I can't remember the exact function name from the top of my head, but it is used in a lot of quests so you can just take a look).
Now, there is only one issue. I don't remember if this function is part of the internal or external scripting. If it's external then it's all good, because player data will be accessible, but if it's internal then it won't be and you won't be able to do that.
Perhaps ai_enabled can tell that, because I'm not particularly familiar with that part of scripting, because I was mostly doing quests and other scripting that is "external" to game logic.
Bottom line is, for now you can just give it a try by pulling the character info there and see if it works. It all depends on environmental context (internal or external).