First of all you seem to write your code in UnityScript. Are you sure this code is in a “.js” file?
Second, almost all programming languages are case sensitive. So casing matters. “update” is not the same as “Update”. You should rename your method.
Another thing that isn’t an actual error but you should be more consitent when naming your variables. There are different conventions. It doesn’t really matter which you use as long as you stay consistent. “health” and “TakeDamage” is not consistent ^^. “takeDamage” would be better.