Your code is wrong here
thePlayer = isElement(thePlayer)
Variable thePlayer now is boolean but you should use userdata in other functions like setElementHealth and etc. So this line in your code is not needed. Also
setTimer (
function ( thePlayer )
setElementHealth ( thePlayer, getElementHealth ( thePlayer ) + 5 )
end
, 2000, 0, source
)
source is not defined in your code. Source is nil. You should use thePlayer variable.