on_actions = {

	on_startup = { # Startup Fixes
		effect = {
		every_country = {
			if = { # Give MG Technology
				limit = {
					OR = {
						has_tech = infantry_weapons
						has_tech = support_weapons
					}
					NOT = { has_tech = infantry_weapons_h }
				}
				set_technology = { infantry_weapons_h = 1 }
				set_variable = {
					var = swAdded
					value = num_equipment_in_armies@infantry_equipment
				}
				multiply_variable = {
					var = swAdded
					value = 0.3
				}
				add_equipment_to_stockpile = {
					type = support_weapon
					amount = swAdded
				}
				clear_variable = swAdded
			}
			if = { # Give M.Howitzer Technology
				limit = {
					OR = {
						has_template_containing_unit = artillery_brigade
						has_template_containing_unit = mot_artillery_brigade
					}
					NOT = { has_tech = gw_artillery_m }
				}
				set_technology = { gw_artillery_m = 1 popup = no }
			}
			if = { # Give L.Howitzer Technology
				limit = {
					OR = {
						has_template_containing_unit = artillery_brigade_cav
					}
					NOT = { has_tech = gw_artillery_l }
				}
				set_technology = { gw_artillery_l = 1 popup = no }
			}
			if = { # Give AT Technology
				limit = {
					OR = {
						has_template_containing_unit = anti_tank
						has_template_containing_unit = anti_tank_brigade
						has_template_containing_unit = mot_anti_tank_brigade
					}
					NOT = { has_tech = interwar_antitank }
				}
				set_technology = { interwar_antitank = 1 popup = no }
			}
			if = { # Give AA Technology
				limit = {
					OR = {
						has_template_containing_unit = anti_air
						has_template_containing_unit = anti_air_brigade
						has_template_containing_unit = mot_anti_air_brigade
					}
					NOT = { has_tech = interwar_antiair }
				}
				set_technology = { interwar_antiair = 1 popup = no }
			}
			set_country_flag = rcs_startup
		}
		}
	}

	on_daily = { # Mid-Game Fixes
		effect = {
			if = { # Re-research
				limit = {
					NOT = { has_country_flag = rcs_startup }
				}
				if = { # IHWs
					limit = { has_tech = support_weapons }
					set_technology = { support_weapons = 1 }
					set_technology = {
						support_weapons = 0
						support_weapons = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = support_weapons2 }
					set_technology = { support_weapons2 = 1 }
					set_technology = {
						support_weapons2 = 0
						support_weapons2 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = support_weapons3 }
					set_technology = { support_weapons3 = 1 }
					set_technology = {
						support_weapons3 = 0
						support_weapons3 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = support_weapons4 }
					set_technology = { support_weapons4 = 1 }
					set_technology = {
						support_weapons4 = 0
						support_weapons4 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = infantry_weapons }
					set_technology = { infantry_weapons = 1 }
					set_technology = {
						infantry_weapons = 0
						infantry_weapons = 1
						popup = no
					}
				}

				if = {
					limit = { has_tech = tech_mountaineers }
					set_technology = { tech_mountaineers1 = 1 }
					set_technology = {
						tech_mountaineers = 0
						tech_mountaineers = 1
						popup = no
					}
				}

				if = {
					limit = { has_tech = tech_support }
					set_technology = { tech_support = 1 }
					set_technology = {
						tech_support = 0
						tech_support = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = tech_engineers }
					set_technology = { tech_engineers = 1 }
					set_technology = {
						tech_engineers = 0
						tech_engineers = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = tech_engineers2 }
					set_technology = { tech_engineers2 = 1 }
					set_technology = {
						tech_engineers2 = 0
						tech_engineers2 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = tech_recon }
					set_technology = { tech_recon = 1 }
					set_technology = {
						tech_recon = 0
						tech_recon = 1
						popup = no
					}
				}

				if = {
					limit = { has_tech = tech_trucks }
					set_technology = { tech_trucks = 1 }
					set_technology = {
						tech_trucks = 0
						tech_trucks = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = motorised_infantry }
					set_technology = { motorised_infantry = 1 }
					set_technology = {
						motorised_infantry = 0
						motorised_infantry = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = mechanised_infantry }
					set_technology = { mechanised_infantry = 1 }
					set_technology = {
						mechanised_infantry = 0
						mechanised_infantry = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = armored_car1 }
					set_technology = { armored_car1 = 1 }
					set_technology = {
						armored_car1 = 0
						armored_car1 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = armored_car2 }
					set_technology = { armored_car2 = 1 }
					set_technology = {
						armored_car2 = 0
						armored_car2 = 1
						popup = no
					}
				}
				
				if = {
					limit = { has_tech = gw_artillery }
					set_technology = {
						gw_artillery = 0
						gw_artillery = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = interwar_artillery }
					set_technology = {
						interwar_artillery = 0
						interwar_artillery = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = artillery1 }
					set_technology = {
						artillery2 = 0
						artillery2 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = artillery2 }
					set_technology = {
						artillery2 = 0
						artillery2 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = artillery3 }
					set_technology = {
						artillery3 = 0
						artillery3 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = artillery4 }
					set_technology = {
						artillery4 = 0
						artillery4 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = interwar_antitank }
					set_technology = {
						interwar_antitank = 0
						interwar_antitank = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = antitank1 }
					set_technology = {
						antitank2 = 0
						antitank2 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = antitank2 }
					set_technology = {
						antitank2 = 0
						antitank2 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = antitank3 }
					set_technology = {
						antitank3 = 0
						antitank3 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = antitank4 }
					set_technology = {
						antitank4 = 0
						antitank4 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = interwar_antiair }
					set_technology = {
						interwar_antiair = 0
						interwar_antiair = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = antiair1 }
					set_technology = {
						antiair2 = 0
						antiair2 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = antiair2 }
					set_technology = {
						antiair2 = 0
						antiair2 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = antiair3 }
					set_technology = {
						antiair3 = 0
						antiair3 = 1
						popup = no
					}
				}
				if = {
					limit = { has_tech = antiair4 }
					set_technology = {
						antiair4 = 0
						antiair4 = 1
						popup = no
					}
				}
			}
			if = { # Infantry Heavy Weapons
				limit = {
					NOT = { has_country_flag = rcs_startup }
					OR = {
						has_tech = infantry_weapons
						has_tech = support_weapons
					}
				}
				set_technology = { infantry_weapons_h = 1 }
				set_variable = {
					var = swAdded
					value = num_equipment_in_armies@infantry_equipment
				}
				multiply_variable = {
					var = swAdded
					value = 0.35
				}
				add_equipment_to_stockpile = {
					type = support_weapon
					amount = swAdded
				}
				clear_variable = swAdded
			}
			if = { # Give M.Howitzer Technology
				limit = {
					NOT = { has_country_flag = rcs_startup }
					OR = {
						has_template_containing_unit = artillery_brigade
						has_template_containing_unit = mot_artillery_brigade
					}
					NOT = { has_tech = gw_artillery_m }
				}
				set_technology = { gw_artillery_m = 1 }
			}
			if = { # Light Artillery
				limit = {
					NOT = { has_country_flag = rcs_startup }
					has_tech = gw_artillery
				}
				set_variable = {
					var = swAdded
					value = num_equipment_in_armies@artillery_equipment
				}
				multiply_variable = {
					var = swAdded
					value = 0.3
				}
				add_equipment_to_stockpile = {
					type = artillery_equipment_l
					amount = swAdded
				}
				clear_variable = swAdded
			}
			if = { # End
				limit = {
					NOT = { has_country_flag = rcs_startup }
				}
				set_country_flag = rcs_startup
			}
		}
	}
	
}