setPythonTag is a Python function like every other Python function. It accepts parameters, which can be literals or variables/constants. You pass HP as the first parameter, which is obviously a variable or constant. And obviously you have missed to define this variable or constant before calling setPythonTag.
HP = "hitpoints"
No, there is no strict rule about swearing. At least I am not aware of one. It’s a matter of common courtesy.
Have you been able to fix your issue? If not using a literal then global variables are a good idea, but you need a decent grip on Python namespaces in oder to ensure that your globals are visible everywhere you need them.