Accessing other script problem

I have 2 scripts; Characterdamage2.js & spawn.js
I want to get a variable in CharacterDamage2 and use it in spawn.
Pretty much I want the variable “hitPoints” in CharacterDamage2 to +=10 with every wave in the spawn script but I don’t know what I’m doing wrong.

I used this; http://docs.unity3d.com/356/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

And got this;

var CharacterDamage2: CharacterDamage2 = hitpoints(CharacterDamage2); CharacterDamage2.hitPoints += 1.0();

Nobody helped me with this code on my old question (Static var wont work - Unity Answers)

Details! The snippet says

var otherScript: OtherScript = GetComponent(OtherScript); 
otherScript.DoSomething();

And you are trying to do it this way:

var OtherScript: OtherScript = GetComponent(OtherScript); 
OtherScript.DoSomething();

It’s similar, but not the same. The variable in the example uses the variable “otherScript”, and a script named “OtherScript”. Your code should work fine if you use a different name for your variable, like this:

var characterDamage2: CharacterDamage2 = hitpoints(CharacterDamage2); 
characterDamage2.hitPoints += 1.0;

But I would use the solution of syclamoth, just to be sure not do any typos later.