So for NX, NX2, NXA(Not Tested) the score works like that.

We have a few defined integer globals:
SCORE_PERFECT = 1000            // This is if you hit a perfect
SCORE_GREAT   = 500 
SCORE_GOOD    = 100
SCORE_BAD     = -200
SCORE_MISS    = -500
SCORE_MISS_LONGNOTE = -300
SCORE_NIGHTMARE_BONUS = 500000  // If the music is double, you get this more at score.
SCORE_GRADE_S = 100000          // If you got S, this is added too.

this is usually used as a ENUM. So for getting scores, we have a little formulae:

Basicly, we use 4 things to calculate: Judgment (those PERFECT, GREAT, GOOD), Combo, Note Number, and a boolean that if is a long note body.

Ok so for calculating, if is a we use a variable integer Score.

if is a long note and the judgement is miss, we have Score = SCORE_MISS_LONGNOTE (that is -300)
else, we have the other table values.

Ok so this is not the only thing to calc. 
If the judgment is less or equal that Great, we have following conditions:
 if Combo >= 51 we add 1000
 if NoteNum >= 4 we multiply by 2 else if NoteNum >= 3 we multiply by 1.5
 
 
This score is added to global score (aka Song Score).

If its a double side, we add SCORE_NIGHTMARE_BONUS, and if it got S, we add SCORE_GRADE_S 
So its like:

if (IsLongNote && (Judgment == eMiss))
	Score = SCORE_MISS_LONGNOTE;
else
	Score = ScoreTable[Judgment - ePerfect];


if (Judgment <= eGreat)	{
	if (Combo >= 51)
		Score += 1000;
	if (NoteNum >= 4)
		Score *= 2;
	else if (NoteNum >= 3)
		Score = int(Score * 1.5f);
}
return Score;
