So i have a question here for ya, looking at your code how often are you sending the useitem packet to cloak yourself?
The normal cloaking ability will have a cooldown lasting longer then your cloak lasts, and you can generally bypass this by sending the useitem packet again right after you come uncloaked. But the clients cooldown will be from the last useitem packet that is sent (from what i recall), even if that useitem packet didnt actually trigger your cloak (possibly because you sent it too early and the server refused to cloak you).