variable Increment by its own value

Hi, Im new here.
I want set up a scenario where on starting a level I can get the number of how many bases there are, find the percentage 1 unit is worth, then when the bases are destroyed one by one I can get a read out of how many percent Im done.
So for example: If the scene has 6 bases every time I destroy one I get 16.667 added onto a total number until it reaches 100%

All is working but adding the value to itself. Im sure its simple, hope someone can help out. Cheers

#pragma strict

var hit = 0;
var strikes = 6;

public var friend : GameObject[];

var lossTotal: float;
var lossUnit: float;


function OnCollisionEnter()
{
    hit +=1;
    checkhit();
    var lossUnit= 100.00f/6; 
}

function checkhit()
{
	if(hit == strikes)
    {
		Destroy(gameObject);
		
		// find the total amount of bases is scene
		friend = GameObject.FindGameObjectsWithTag("friendly");
		var friendlyTotal = friend.Length;
		//print ("total bases remaining "+friendlyTotal);
		
		//increment by its own value
		lossTotal = lossUnit+ lossTotal;
		Debug.Log ("percentage of loss "+lossTotal);
	}
}

“on starting a level I can get the number of how many bases there are”

bases = GameObject.FindGameObjectsWithTag("friendly").Length;

“find the percentage 1 unit is worth”

percentPerUnit = 1.0 / bases;

“then when the bases are destroyed one by one, I can get a read out of how many percent Im done”

percentDone += percentPerUnit;

Though, you need to figure out how many bases there are at start of the game and not every time you collide with something. Since you don’t want to repeat that count for every base you have, it could be better to create a new script, perhaps called FriendlyBases, that manage score tracking. You could also calculate the percentage as percent = destroyedBases / totalBases. To get a nice readable string, you can convert that like this:

text = String.Format("Destroyed bases: {0:P2}", percent);

You could then, when you destroy a base tell FriendlyUnits that a base has been destroyed and ask it for a nice string to log the result.

    // OneBaseDestroyed() impl.
    //     ++destroyedBases;
FriendlyBases.OneBaseDestroyed();

    // GetDestroyedBasesText() impl.
    //     var totalBasesAsFloat : float = totalBases;
    //     var percent : float = destroyedBases / totalBasesAsFloat;
    //     return String.Format("Destroyed bases: {0:P2}", percent);
Debug.Log(FriendlyBases.GetDestroyedBasesText());