I assume you are asking how to get a reference of a script that is attached to another GameObject.
You are almost correct. The type on the left and the type in the GetComponent must match.
SomeVariableDefinition TargetStatus = Target.GetComponent<SomeVariableDefinition>();
OR
Status TargetStatus = Target.GetComponent<Status>();
Understand that if the Target GameObject does not have that script you want to access, it will return null.
Below is full Example of how to access Another script instance, variable or function from another script.
public class ScriptA : MonoBehaviour{
public int playerScore = 0;
void Start()
{
}
public void doSomething()
{
}
}
Now, you can access variable playerScore in ScriptA from ScriptB.
public class ScriptB : MonoBehaviour{
ScriptA scriptInstance = null;
void Start()
{
GameObject tempObj = GameObject.Find("NameOfGameObjectScriptAIsAttachedTo");
scriptInstance = tempObj.GetComponent<ScriptA>();
//Access playerScore variable from ScriptA
scriptInstance.playerScore = 5;
//Call doSomething() function from ScriptA
scriptInstance.doSomething();
}
}