The GetSkill method has to be called from an instance of an object derived from the Mob class. Your use of $GetSkill looks like it's assuming coderefs that I wrote in another script blurb (AutoTrain). The reason it's not working is that you don't have $GetSkill defined anywhere (that I can see in what you pasted anyways). You'll either need to pull that in from the script you got it from or use this:
Code:
$client->GetSkill($skill)
Additionally, you have a typo in one of your undefined methods. Then there's that last if statement at the end of the if/elsif chain...
As for suggestions? Something about less coffee comes to mind...