A planet's defense is reduced if the planet gets damaged.

Eff_Planet_Defense =
   Trunc(Planet_Defense * (100 - Damage) / 100)
Eff_Base_Defense =
   Trunc(Base_Defense * (100 - Damage) / 100)
Eff_Total_Defense =
   Trunc((Base_Defense + Planet_Defense) * (100 - Damage) / 100)

A base's tech level is reduced if the base gets damaged. Here's the formula for beam tech, it applies to the other areas as well.

Eff_Beam_Tech =
   Beam_Tech
   ...at most Trunc((100 - Base_damage) / 10)
   ...at least 1

Planet's equipment in combat:

Combat_mass =
   100 + Eff_Planet_Defense
   ...plus Eff_Base_Defense if base exists

Beam_type =
   Round(Sqrt(Eff_Planet_Defense / 2))
                     ...if no base
   Max(above, Eff_Beam_Tech)
                     ...if base present

Beam_count =
   Round(Sqrt(Eff_Total_Defense / 3))
   ...at most 10 if AllowAlternativeCombat is off
   ...at most 20 if AllowAlternativeCombat is on

Torp_type =
   Round(Sqrt(Eff_Planet_Defense / 2))
                     ...if no base
   Max(above, Eff_Torp_Tech)
                     ...if base present

Tube_count =
   Round(Sqrt(Eff_Total_Defense / 4))
   ...at most 20

Torp_count =
   Tube_count * PlanetaryTorpsPerTube
   ...plus Trunc(Base_torp_cost / Torp_money_cost(Torp_type))
      if base present
   ...at most 255

   Base_torp_cost =
      Torp_money_cost(1) * Torps_in_storage(1)
      + Torp_money_cost(2) * Torps_in_storage(2)
      ...
      + Torp_money_cost(10) * Torps_in_storage(10)