Object hit with multiple shotgun bullets only taking damage from one bullet?

private void OnCollisionStay(Collision collision)
{

        if (collision.transform.tag == "Bullettag")
        {
            if (collision.gameObject.GetComponent<BulletScript>().playerbullet == true)
            {
                attackedByPlayer = true;
                player = collision.gameObject.GetComponent<BulletScript>().player;
            }
            HP -= ((collision.gameObject.GetComponent<BulletScript>().firedamage) * (1-(fireresist/100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().icedamage) * (1 - (iceresist / 100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().ballisticdamage) * (1 - (ballisticresist / 100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().bluntdamage) * (1 - (bluntresist / 100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().chaosdamage) * (1 - (chaosresist / 100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().electricdamage) * (1 - (electricresist / 100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().normaldamage) * (1 - (normalresist / 100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().poisondamage) * (1 - (poisonresist / 100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().psychedamage) * (1 - (psycheresist / 100)));
            HP -= ((collision.gameObject.GetComponent<BulletScript>().aciddamage) * (1 - (acidresist / 100)));
}
}

I have a script that’s meant to have an enemy take damage from a bullet when they’re hit by the bullet. This code works perfectly fine for individual bullets, but when I try to make a shotgun (with about 6 projectiles) the enemy is only ever hit by one bullet at a time, since its health only decrements by the damage of one bullet. How would I get around this?

A way around this is to move your health decrement logic into the bullets it self. Instead of your target dealing with what hit it, move the logic into the bullet, which applies a modifier to the hit object.

This way, each bullet is responsible for dealing damage to the hit object, not the hit object working out who hit it and what damage was caused.

That way you could create a shotgun with 30 bullets firing at the same time, each individual bullet would then apply damage.