BCE0023: No appropriate version of 'UnityEngine.Component.GetComponent' for the argument list '(UnityEngine.TextMesh)' was found.

New to programming so sorry if this is simple. I am trying to use a textmesh code to edit a 3D text in game. basically what i have done is assigned an invisible integer as its health, that integer is sent to a string so i can use that string to edit the 3D text (hopefully that makes sense)
Here is my code.

#pragma strict
var Militia : GameObject;
var hp : GameObject;
var cube : GameObject;
var trigger : GameObject;
var red_hp : int = 100;
var red_range : boolean = false;
var hp_value : String ="";
var hp_real : TextMesh;
function Start () 
{
    Militia.SetActive(false);
    hp.SetActive(false);
    red_range = false;
}

function Update () 
{
    if(Input.GetKeyUp(KeyCode.F))
    {
        if(red_range == true)
        {
            red_hp = red_hp - 25;
            hp_value= red_hp.ToString();
            GetComponent(hp_real).text = hp_value; << Error is here
            if (red_hp <=0)
            {
                Destroy (cube);
                Destroy (Militia);
                Destroy(hp);
            }
        }
    }
}

function OnTriggerEnter (trigger : Collider)
    {  
        Militia.SetActive(true);
        hp.SetActive(true);
        red_range = true;
    }
function OnTriggerExit (trigger : Collider)
{  
    if (red_hp >=0)
    {
        Militia.SetActive(false);
        hp.SetActive(false);
        red_range = false;
    }
}

Any help will be appreciated

Thanks

hp_real = GetComponent();
hp_real.text = hp_value;

Edit: oh, right, it’s in JS, not C#.

hp_real = GetComponent.<TextMesh>();
hp_real.text = hp_value;

Never mind fixed it.
Took out
hp_real = GetComponent();
And it worked.

Thank you for your help