country_decisions = {
	declare_hanseatic_league = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			was_never_end_game_tag_trigger = yes
			NOT = { has_country_flag = formed_hsa_flag }
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			OR = {
				is_free_or_tributary_trigger = yes
				ai = no
			}
			NOT = { tag = HSA }
			NOT = { tag = HLR }
			NOT = { tag = PAP }
			NOT = { tag = GBR }
			OR = {
				culture_group = germanic
				tag = GOT
				tag = RIG
				tag = DNZ
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
			owns = 45
			
			#New added MMETR
			OR = {
				has_institution = guilds
				AND = {
					NOT = {
						has_institution = guilds
					}
					government = republic
				}
			}
		}
		provinces_to_highlight = {
			OR = {
				province_id = 45
				province_id = 44
				province_id = 1874
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		}
		allow = {
			is_at_war = no
			is_free_or_tributary_trigger = yes
			is_nomad = no			
			NOT = { exists = HSA }
			owns_core_province = 44
			owns_core_province = 45
			owns_core_province = 1874
			45 = { is_state = yes }
			is_emperor = no
			OR = {
				mercantilism = 40
				government = republic
				estate_influence = {
					estate = estate_burghers
					influence = 90
				}
				NOT = { num_of_cities = 25 }
			}
			45 = { is_strongest_trade_power = ROOT }
		}
		effect = {
			45 = { move_capital_effect = yes }
			hidden_effect = {
				change_tag = HSA
				on_change_tag_effect = yes
				set_country_flag = hsa_proclaimed_queen_of_the_hansa_flag
				override_country_name = FU2
				set_country_flag = is_FU2_flag
			}
			custom_tooltip = reform_hanseatic_league_tt
			swap_non_generic_missions = yes
			if = {
				limit = {
					OR = {
						is_part_of_hre = no
						is_elector = yes
					}
					NOT = { government_rank = 2 }
				}
				set_government_rank = 2
			}
			if = { 
				limit = { 
					OR = { 
						NOT = { government = republic }
						NOT = { has_reform = merchant_republic } 
					}
				}
				custom_tooltip = become_merchant_republic_tt
				hidden_effect = { 
					change_government = republic
					add_government_reform = merchants_reform
					add_republican_tradition = 100 
				}
			}
			add_country_modifier = {
				name = "centralization_modifier"
				duration = 7300
			}
			add_prestige = 25
			set_country_flag = formed_hsa_flag
			if = {
				limit = { has_custom_ideas = no }
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
		}

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = { government = republic }
			}
			modifier = {
				factor = 0
				has_reform = free_city
			}
			modifier = {
				factor = 0
				exists = HSA
			}
		}
		ai_importance = 400
	}
}