unite_the_levant_category = {
    form_greater_syria = {
        icon = generic_form_nation

        allowed = {
            OR = {
                original_tag = LEB
                original_tag = SYR
                original_tag = JOR
            }
        }
        fire_only_once = yes
        available = {
            is_subject = no
            custom_trigger_tooltip = {
                tooltip = form_country_gs_syria_required_states_tt
                controls_state = 680
                controls_state = 677
                controls_state = 554
            }
            controls_state = 553
            custom_trigger_tooltip = {
                tooltip = form_country_gs_israel_palestina_required_states_tt
                controls_state = 454
                controls_state = 1016
                controls_state = 1017
                controls_state = 949
                controls_state = 966
            }
            controls_state = 455
            controls_state = 1021
            controls_state = 1022
            NOT = { has_cosmetic_tag = ARA_UNIFIED }
            NOT = { has_completed_focus = PAL_islamists }
        }
        complete_effect = {
            set_cosmetic_tag = SYR_UNIFIED
            custom_effect_tooltip = form_country_gs_required_coring_states_tt
            hidden_effect = {
                every_state = {
                    limit = {
                        OR = {
                            is_core_of = JOR
                            is_core_of = LEB
                            is_core_of = PAL
                            is_core_of = SYR
                        }
                    }
                    add_core_of = ROOT #ROOT
                    #Siria, Libano, Palestina, Jordan
                }
                news_event = { id = r56.news_event.34 hours = 6 }

                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = JOR
                                    has_nationality = LEB
                                    has_nationality = PAL
                                    has_nationality = SYR
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }
            }
            set_capital = {
                state = 554
            }
            set_province_name = { id = 1086 name = "Al-Quds" }
            custom_effect_tooltip = form_country_gs_iraq_kuwait_coring_states_tt
            hidden_effect = {
                add_state_core = 453
                add_state_claim = 676
                add_state_claim = 675
                add_state_claim = 291
                add_state_claim = 1049
                add_state_claim = 1048
                add_state_claim = 1046
                add_state_claim = 1047
                add_state_claim = 1045

            }

            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 200
            modifier = {
                factor = 0.1
                is_historical_focus_on = yes
            }
        }
    }
}

unify_the_peninsula_category = {
    unite_korea = {
        icon = GFX_decision_korea_unification

        allowed = {
            OR = {
                original_tag = KOR
                original_tag = NKR
            }
        }
        fire_only_once = yes
        available = {
            is_subject = no
            custom_trigger_tooltip = {
                tooltip = form_country_joseon_south_korea_required_states_tt
                controls_state = 525
                controls_state = 919
                controls_state = 920
            }
            custom_trigger_tooltip = {
                tooltip = form_country_joseon_north_korea_required_states_tt
                controls_state = 527
                controls_state = 917
                controls_state = 918
            }
            NOT = { has_cosmetic_tag = KOR_unified }
        }
		visible = {
            original_tag = JAP
			NOT = { has_global_flag = unite_joseon_flag }
		}
        complete_effect = {
            set_cosmetic_tag = KOR_unified
            custom_effect_tooltip = form_country_joseon_korea_coring_states_tt
            hidden_effect = {
                every_state = {
                    limit = {
                        OR = {
                            is_core_of = KOR
                            is_core_of = NKR
                        }
                    }
                    add_core_of = ROOT #ROOT
                    #North and South Korea
                }
				set_global_flag = unite_joseon_flag

                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = KOR
                                    has_nationality = NKR
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }

            }

            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 200
        }
    }
}

##form_peru_bolivia_category = {
##    form_peru_bolivia = {
##        fire_only_once = yes
##        icon = generic_form_nation
##
##        allowed = {
##            OR = {
##                original_tag = BOL
##                original_tag = PRU 
##                    
##            }
##        }
##        available = {
##               if = {
##               Limit = {
##                    original_tag = PRU 
##                       }
##                      NOT = { 
##                 OR = { 
##                   has_country_flag = formed_peru_bolivia
##                   has_country_flag = PRU_no_peru_bolivia
##                   has_country_flag = PRU_no_inca_peru_bolivia
##                      }
##                     }
##                        }
##           
##            all_state = {
##                OR = {
##                    NOT = { is_core_of = PRU }
##                    is_core_of = ECU
##                    is_controlled_by = ROOT
##                }
##            }
##            all_state = {
##                OR = {
##                    NOT = { is_core_of = BOL }
##                    is_core_of = PAR
##                    is_core_of = CHL
##                    is_core_of = BRA
##                    is_controlled_by = ROOT
##                }
##            }
##        }
##
##        complete_effect = {
##
##            hidden_effect = {
##                if = {
##                    limit = {
##                        has_dlc = "La Resistance"
##                    }
##                    every_country = {
##                        every_operative = {
##                            limit = {
##                                OR = {
##                                    has_nationality = PRU
##                                    has_nationality = BOL
##                                }
##                                NOT = {
##                                    has_nationality = ROOT
##                                }
##                            }
##                            add_nationality = ROOT
##                        }
##                    }
##                }                
##            }
##
##            set_country_flag = formed_peru_bolivia
##            set_cosmetic_tag = PRB
##            688 = { add_core_of = ROOT }
##            506 = { add_core_of = ROOT }
##            490 = { add_core_of = ROOT }
##            1052 = { add_core_of = ROOT }
##        }
##        remove_effect = {
##            hidden_effect = {
##                every_state = {
##                    limit = {
##                        OR = { is_core_of = BOL is_core_of = PRU }
##                    }
##                    add_core_of = PREV
##                }
##            }
##        }
##        remove_effect = {
##            add_ideas = generic_recent_political_unification
##            add_ideas = generic_recent_army_unification
##            add_ideas = generic_recent_economic_unification
##        }
##        ai_will_do = {
##            factor = 1
##        }
##    }
##}
##

form_russia_category = {

    form_russia = {
        icon = generic_form_nation
        cost = 0
        fire_only_once = yes

        allowed = { original_tag = LIE }

        available = {
            is_subject = no
            controls_state = 195
            controls_state = 208
            controls_state = 209
            controls_state = 210
            controls_state = 263
            controls_state = 244
            controls_state = 246
            controls_state = 242
            controls_state = 243
            controls_state = 224
            controls_state = 219
            controls_state = 205
            controls_state = 247
            controls_state = 264
            controls_state = 216
            controls_state = 215
            controls_state = 220
            controls_state = 222
            controls_state = 223
            controls_state = 240
            controls_state = 258
            controls_state = 254
            controls_state = 260
            controls_state = 257
            controls_state = 255
            controls_state = 252
            controls_state = 253
            controls_state = 248
            controls_state = 351
            controls_state = 879
            controls_state = 214
            controls_state = 880
        }

        ai_will_do = {
            factor = 150
        }

        visible = {
            NOT = {
                country_exists = SOV
            }
            if = {
                limit = {
                    original_tag = LIE
                }
                has_country_leader = {
                    character = LIE_boris_smyslovsky
                    ruling_only = yes
                }
            }
        }

        complete_effect = {
            set_capital = { state = 219 }
            add_state_core = 195
            add_state_core = 208
            add_state_core = 209
            add_state_core = 210
            add_state_core = 263
            add_state_core = 244
            add_state_core = 246
            add_state_core = 242
            add_state_core = 243
            add_state_core = 224
            add_state_core = 219
            add_state_core = 205
            add_state_core = 247
            add_state_core = 264
            add_state_core = 216
            add_state_core = 215
            add_state_core = 220
            add_state_core = 222
            add_state_core = 223
            add_state_core = 240
            add_state_core = 258
            add_state_core = 254
            add_state_core = 260
            add_state_core = 257
            add_state_core = 255
            add_state_core = 252
            add_state_core = 253
            add_state_core = 248
            add_state_core = 351
            add_state_core = 879
            add_state_core = 214
            add_state_core = 880
            set_cosmetic_tag = SOV
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
            if = {
                limit = {
                    original_tag = LIE
                }
                set_country_flag = achievement_formed_russia
            }
        }
    }
    reclaim_the_kuban_region = {
        icon = generic_form_nation
        cost = 0
        fire_only_once = yes

        allowed = { original_tag = LIE }

        available = {
            is_subject = no
            controls_state = 239
            controls_state = 265
            controls_state = 245
            controls_state = 401
            controls_state = 829
            controls_state = 217
            controls_state = 218
            controls_state = 238
            controls_state = 234
            controls_state = 235
            controls_state = 237
            controls_state = 236
            controls_state = 232
            controls_state = 821
            controls_state = 828
            controls_state = 827
            controls_state = 233
        }

        ai_will_do = {
            factor = 150
        }

        visible = {
            has_cosmetic_tag = SOV
            if = {
                limit = {
                    original_tag = LIE
                }
                #has_country_leader = {
                #    character = LIE_boris_smyslovsky
                #    ruling_only = yes
                #}
            }
        }

        complete_effect = {
            add_state_core = 293
            add_state_core = 265
            add_state_core = 245
            add_state_core = 401
            add_state_core = 829
            add_state_core = 217
            add_state_core = 218
            add_state_core = 238
            add_state_core = 234
            add_state_core = 235
            add_state_core = 237
            add_state_core = 236
            add_state_core = 232
            add_state_core = 821
            add_state_core = 828
            add_state_core = 827
            add_state_core = 233
        }
    }
}

form_prussia_category = {

    form_prussia = {
        icon = generic_form_nation
        cost = 0
        fire_only_once = yes

        allowed = { original_tag = DNZ }

        available = {
            controls_state = 64
            controls_state = 68
            controls_state = 63
            controls_state = 66
            controls_state = 67
            controls_state = 807
            controls_state = 86
            controls_state = 762
            controls_state = 85
            controls_state = 62
            controls_state = 5
            controls_state = 763
        }

        ai_will_do = {
            factor = 150
        }

        #visible = {
        #    OR = { #weird conditions removed
        #        controls_state = 64
        #        controls_state = 5
        #        controls_state = 63
        #        controls_state = 807
        #        has_completed_focus = DNZ_prussia_legacy
        #    }
        #}

        complete_effect = {
            add_state_core = 64
            add_state_core = 68
            add_state_core = 63
            add_state_core = 66
            add_state_core = 67
            add_state_core = 807
            add_state_core = 86
            add_state_core = 762
            add_state_core = 763
            add_state_core = 188
            add_state_core = 85
            add_state_core = 62
            add_state_core = 5
            #set_cosmetic_tag = PRS
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }
    }
}

recreate_belgium_category = {

    recreate_belgium = {
        allowed = {
            OR = {
                original_tag = WLL
                original_tag = FLA
            }
            is_ai1 = yes
        }
        fire_only_once = yes
        available = {
            if = {
                limit = { original_tag = FLA }
                NOT = { has_government = fascism }
            }
            is_subject = no
            6 = { is_controlled_by = ROOT }
            34 = { is_controlled_by = ROOT }
			1094 = { is_controlled_by = ROOT }
            1095  = { is_controlled_by = ROOT }
			965 = { is_controlled_by = ROOT }
        }
        icon = generic_form_nation
        complete_effect = {
#            set_cosmetic_tag = BEL_REUNIFIED
            set_country_flag = reunified_belgium_flag

            if = {
                limit  = {
                    ROOT = { has_government = democratic }
                }
                if = {
                    limit = { BEL = { democratic < 0.5 } }
                    BEL = {
                        add_popularity = { ideology = democratic popularity = 0.33 }
                        set_politics = {
                            ruling_party = democratic elections_allowed = yes
                        }
                    }
                }
                else = {
                    BEL = {
                        unlock_national_focus = BEL_form_coalition_government
                    }
                }
            }

            if = {
                limit  = {
                    ROOT = { has_government = neutrality }
                }
                if = {
                    limit = {
                        BEL = { neutrality < 0.5 }
                    }
                    BEL = {
                        add_popularity = { ideology = neutrality popularity = 0.33 }
                        set_politics = {
                            ruling_party = neutrality elections_allowed = yes
                        }
                    }
                }
                else = {
                    BEL = {
                        unlock_national_focus = BEL_king_reaction
                    }
                }
            }

            if = {
                limit  = {
                    ROOT = { has_government = communism }
                }
                if = {
                    limit  = {
                        BEL = { communism < 0.5 }
                    }
                    BEL = {
                        add_popularity = { ideology = communism popularity = 0.33 }
                        set_politics = {
                            ruling_party = communism elections_allowed = no
                        }
                    }
                }
                if = { #Check. If exclusive, then use else_if.
                    limit  = {
                        BEL = { has_idea = BEL_leopold3 }
                    }
                    BEL = {
                        swap_ideas = {
                            remove_idea = BEL_leopold3
                            add_idea = BEL_leopold3_exile
                        }
                    }
                }
                else = {
                    BEL = {
                        unlock_national_focus = BEL_go_left
                    }
                }
            }

            else = { #Fascist branch
#                limit = { ROOT = { has_government = fascism } }
                if = {
                    limit  = {
                        BEL = { fascism < 0.5 }
                    }
                    BEL = {
                        add_popularity = { ideology = fascism popularity = 0.33 }
                        set_politics = {
                             ruling_party = fascism elections_allowed = no
                        }
                    }
                }
                if = { #Check. If exclusive, then use else_if.
                    limit  = {
                        BEL = { has_idea = BEL_leopold3 }
                    }
                    BEL = {
                        swap_ideas = {
                            remove_idea = BEL_leopold3
                            add_idea = BEL_leopold3_exile
                        }
                    }
                }
                else = {
                    BEL = {
                        unlock_national_focus = BEL_go_right
                        unlock_national_focus = BEL_choose_Rex
                    }
                }
            }

            BEL = {
                set_capital = { state = 6 }
                add_ideas = generic_recent_political_unification
                add_ideas = generic_recent_army_unification
                add_ideas = generic_recent_economic_unification
                set_country_flag = BEL_1936_election
                annex_country = {
                    target = ROOT
                    transfer_troops = yes
                }
                change_tag_from = ROOT
            }
            FLA = {
                every_unit_leader = {
                    set_nationality = BEL
                }
                # exclude regional nationalists
            }
            WLL = {
                every_unit_leader = {
                    set_nationality = BEL
                }
            }
        }

        ai_will_do = {
            factor = 200
            modifier = {
                factor = 0
                is_historical_focus_on = yes
            }
        }
    }
}

form_united_netherlands_category2 = {
    form_united_netherlands2_BEL = {
        icon = generic_form_nation

        allowed = { 
            original_tag = BEL 
            is_ai1 = yes 
        }
        visible = {
            NOT = { has_global_flag = form_united_netherlands_flag }
        }
        available = {
            is_subject = no
            OR = {
                has_country_flag = Chose_Verdinaso
                has_completed_focus = BEL_go_left
            }

            # Netherlands
                custom_trigger_tooltip = {
                    tooltip = form_eu_netherlands_required_states_tt
                    controls_state = 7
                    controls_state = 35
                    controls_state = 36
                    owns_state = 7
                    owns_state = 35
                    owns_state = 36
                }
            # Belgium
                custom_trigger_tooltip = {
                    tooltip = form_eu_belgium_required_states_tt
                    controls_state = 6
                    controls_state = 34
					controls_state = 1094
                    controls_state = 1095
					controls_state = 965
                    owns_state = 6
                    owns_state = 34
					owns_state = 1094
                    owns_state = 1095
					owns_state = 965
                }
            }

        complete_effect = {
            custom_effect_tooltip = form_eu_netherlands_coring_states_tt
            hidden_effect = {
                set_cosmetic_tag = BEL5
                every_state = {
                    limit = { region = 5 NOT = { state = 8 } }
                    add_core_of = ROOT
                }
            }
            hidden_effect = {
                news_event = { id = wtt_news.58 hours = 6 }
                set_global_flag = form_united_netherlands_flag
            }
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }
        ai_will_do = {
            factor = 200
            modifier = {
                factor = 0
                is_historical_focus_on = yes
            }
        }
    }

    form_united_netherlands2_HOL = {
        icon = generic_form_nation

        allowed = { 
            original_tag = HOL 
            is_ai1 = yes
        }

        visible = {
            NOT = { has_global_flag = form_united_netherlands_flag
				original_tag = HOL
			}
        }

        available = {
            is_subject = no
            OR = {
                has_government = fascism
                has_government = communism
            }
            # Netherlands
                custom_trigger_tooltip = {
                    tooltip = form_eu_netherlands_required_states_tt
                    controls_state = 7
                    controls_state = 35
                    controls_state = 36
                    owns_state = 7
                    owns_state = 35
                    owns_state = 36
                }
            # Belgium
                custom_trigger_tooltip = {
                    tooltip = form_eu_belgium_required_states_tt
                    controls_state = 6
                    controls_state = 34
					controls_state = 1094
                    controls_state = 1095
					controls_state = 965
                    owns_state = 6
                    owns_state = 34
					owns_state = 1094
                    owns_state = 1095
					owns_state = 965
                }
            }

        complete_effect = {
            custom_effect_tooltip = form_eu_belgium_coring_states_tt
            hidden_effect = {
                set_cosmetic_tag = BEL5
                every_state = {
                    limit = { region = 5 NOT = { state = 8 } }
                    add_core_of = ROOT
                }
            }
            hidden_effect = {
                news_event = { id = wtt_news.58 hours = 6 }
                set_global_flag = form_united_netherlands_flag
            }
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }
        ai_will_do = {
            factor = 200
            modifier = {
                factor = 0
                is_historical_focus_on = yes
            }
        }
    }
}

form_carribean_category = {
    form_caribbean = {
        icon = generic_form_nation
        days_re_enable = 0

        allowed = {
            OR = {
                original_tag = DOM
                original_tag = HAI
                original_tag = CUB
				original_tag = JAM
				original_tag = PUE
				original_tag = BAH
                original_tag = TRI
                original_tag = GDL
                original_tag = CRC
                original_tag = STK
				original_tag = DMN
				original_tag = BRB
				original_tag = STL
				original_tag = SVG
				original_tag = GRA
                original_tag = MAR
            }
        }
        fire_only_once = yes
        available = {
            994 = { is_controlled_by = ROOT }
            315 = { is_controlled_by = ROOT }
            318 = { is_controlled_by = ROOT }
            319 = { is_controlled_by = ROOT }
        }
        complete_effect = {
            set_cosmetic_tag = CAB
            hidden_effect = {
                every_state = { #This has a day of lag, for reasons
                    limit = {
                        OR = { is_core_of = CUB is_core_of = DOM is_core_of = HAI }
                    }
                    add_core_of = ROOT
                }
                news_event = { id = r56.news_event.35 hours = 6 }


                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = DOM
                                    has_nationality = HAI
                                    has_nationality = CUB
                                    has_nationality = JAM
                                    has_nationality = PUE
                                    has_nationality = BAH
                                    has_nationality = TRI
                                    has_nationality = GDL
                                    has_nationality = CRC                                    
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }

            }
            every_state = { #This has a day of lag, for reasons
                limit = {
                    OR = { is_core_of = TRI is_core_of = PUE is_core_of = BAS is_core_of = GDL is_core_of = BAH is_core_of = CRC is_core_of = JAM is_core_of = STK is_core_of = DMN is_core_of = BRB is_core_of = STL is_core_of = SVG is_core_of = GRA is_core_of = MAR    }
                }
                add_core_of = ROOT
            }
            972 = {
                add_core_of = ROOT
            }
            1050 = {
                add_core_of = ROOT
            }
        }
        ai_will_do = {
            factor = 50
        }
    }
}

ENG_restore_the_UK = {
    unite_britain = {
        days_re_enable = 0
        fire_only_once = yes

        visible = { original_tag = ENG }
        available = { #Scotland & Wales
            is_subject = no
            NOT = {
                any_state = {
                    OR = {
                        is_core_of = SCO
                        is_core_of = WLS
                        state = 119
                    }
                    NOT = {
                        OR = {
                            is_controlled_by = ROOT
                            OWNER = {
                                is_puppet_of = ROOT
                            }
                        }
                    }
                }
            }
            #119 = { is_controlled_by = ROOT }
        }
        icon = eng_install_government

        complete_effect = {
            drop_cosmetic_tag = yes
            every_state = {
                limit = {
                    OR = {
                        is_core_of = SCO
                        is_core_of = WLS
                        state = 119
                    }
                }
                add_core_of = ROOT
            }
            set_capital = { state = 126 }
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
            hidden_effect = {
                news_event = { id = r56.news_event.38 hours = 6 }
            }
        }
        ai_will_do = {
            factor = 50
        }
    }
}

celtic_unification_category = {
    form_celtic_union = {
        icon = generic_form_nation
        fire_only_once = yes
        allowed = {
            OR = {
                original_tag = SCO
                original_tag = IRE
                original_tag = NIR
                original_tag = BRI
                original_tag = WLS
            }
        }
        available = {
            is_subject = no
            #IRE
            controls_state = 113
            controls_state = 119
            controls_state = 134
            controls_state = 135
            #WLS
            controls_state = 122
            #SCO
            controls_state = 133
            controls_state = 121
            controls_state = 136
            controls_state = 120
            controls_state = 123
            #BRI
            controls_state = 14

			# isle of man
			controls_state = 1042

        }
        complete_effect = {

            set_cosmetic_tag = CEL_UNIFIED
            hidden_effect = {
                113 = { add_core_of = ROOT }
                119 = { add_core_of = ROOT }
                #114 = { add_core_of = ROOT }
                134 = { add_core_of = ROOT }
                135 = { add_core_of = ROOT }
                122 = { add_core_of = ROOT }
                133 = { add_core_of = ROOT }
                121 = { add_core_of = ROOT }
                136 = { add_core_of = ROOT }
                120 = { add_core_of = ROOT }
                123 = { add_core_of = ROOT }
                970 = { add_core_of = ROOT }
                971 = { add_core_of = ROOT }
                14 = { add_core_of = ROOT }
				1042 = { add_core_of = ROOT }
                news_event = { id = r56.news_event.33 hours = 6 }

                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = SCO
                                    has_nationality = IRE
                                    has_nationality = NIR
                                    has_nationality = BRI
                                    has_nationality = WLS
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }
            }
            123 = { 
                add_core_of = ROOT 
                set_state_name = "Cornwall"
            }

            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
            hidden_effect = {
                set_party_name = {
                    ideology = neutrality
                    long_name = CEL_UNIFIED_neutrality_party_long
                    name = CEL_UNIFIED_neutrality_party
                }
                set_party_name = {
                    ideology = democratic
                    long_name = CEL_UNIFIED_democratic_party_long
                    name = CEL_UNIFIED_democratic_party
                }
                set_party_name = {
                    ideology = communism
                    long_name = CEL_UNIFIED_communism_party_long
                    name = CEL_UNIFIED_communism_party
                }
                set_party_name = {
                    ideology = fascism
                    long_name = CEL_UNIFIED_fascism_party_long
                    name = CEL_UNIFIED_fascism_party
                }                               

            }

        }

        ai_will_do = {
            factor = 200
        #   modifier = {
        #       factor = 0
        #       is_historical_focus_on = yes
        #   }
        }
    }

    CEL_UNIFIED_integrate_galicia = {
        icon = generic_form_nation

        allowed = {
            OR = {
                original_tag = SCO
                original_tag = IRE
                original_tag = NIR
                original_tag = BRI
                original_tag = WLS
            }
        }

        cost = 50

        available = {
            is_subject = no
            # Galicia
            controls_state = 171
            171 = { compliance > 40 }
        }

        visible = {
            has_cosmetic_tag = CEL_UNIFIED
        }

        days_remove = 90

        remove_effect = {
            171 = { add_core_of = ROOT }
        }

        ai_will_do = {
            factor = 200
        #    modifier = {
        #        factor = 0
        #        is_historical_focus_on = yes
        #    }
        }
    }

    CEL_UNIFIED_wall_of_steel = {
        icon = generic_political_discourse
        fire_only_once = yes

        allowed = {
            OR = {
                original_tag = SCO
                original_tag = IRE
                original_tag = NIR
                original_tag = WLS
            }
        }

        cost = 25

        visible = {
            has_cosmetic_tag = CEL_UNIFIED
            NOT = { original_tag = BRI }
        }

        complete_effect = {
        #    BRI = { retire_character = BRI_francois_taldir_jaffrennou }
        #    ROOT = { recruit_character = BRI_francois_taldir_jaffrennou }
            #set_nationality is what the wiki recommends but it doesn't work.
           # BRI_francois_taldir_jaffrennou = {
           #     set_nationality = ROOT
           # }
            every_possible_country = {
                limit = { has_character = BRI_francois_taldir_jaffrennou }
                random_character = {
                    limit = {
                        is_character = BRI_francois_taldir_jaffrennou
                    }
                    set_nationality = ROOT
                }
            }
            set_country_flag = CEL_francois_recruited
        }

        ai_will_do = {
            factor = 200
        }
    }
}

#form_turkestan_category = {
#    form_turkestan = {
#        icon = generic_form_nation
#        fire_only_once = yes
#
#        allowed = {
#            OR = {
#                original_tag = KAZ
#                original_tag = UZB
#                original_tag = TMS
#                original_tag = TAJ
#                original_tag = KYR
#                original_tag = TAN
#                #AND = { #Can't add Sinkiang until a solution is found regarding the political struggle in China
#                #    original_tag = SIK
#                #    NOT = {
#                #        tag = event_target:WTT_current_china_leader
#                #    }
#                #}
#            }
#        }
#
#        available = {
#            is_subject = no
#            # Kazakhstan
#            custom_trigger_tooltip = {
#                tooltip = form_country_kazakhstan_required_states_tt
#                all_state = {
#                    OR = {
#                        NOT = { is_core_of = KAZ }
#                        is_controlled_by = ROOT
#                    }
#                }
#            }
#            # Uzbekistan
#            custom_trigger_tooltip = {
#                tooltip = form_country_uzbekistan_required_states_tt
#                controls_state = 405
#                controls_state = 585
#            }
#            # Turkmenistan
#            custom_trigger_tooltip = {
#                tooltip = form_country_turkmenistan_required_states_tt
#                controls_state = 584
#            }
#            # Tajikistan
#            custom_trigger_tooltip = {
#                tooltip = form_country_tajikistan_required_states_tt
#                controls_state = 742
#            }
#            # Kyrgyzstan
#            custom_trigger_tooltip = {
#                tooltip = form_country_kyrgyzstan_required_states_tt
#                controls_state = 732
#            }
#        }
#
#        complete_effect = {
#            set_cosmetic_tag = TRK_UNITED
#            hidden_effect = {
#                every_state = {
#                    limit = {
#                        OR = {
#                            region = 136 #The Great Steppe, contains most of the provinces.
#                            region = 145 #Sinkiang
#                            is_core_of = TAN #Tannu Tuva
#                            is_core_of = KAZ #Kazakhstan
#                        }
#                    }
#                    add_core_of = ROOT
#                }
#            }
#            # Kazakhstan
#            custom_effect_tooltip = form_country_kazakhstan_coring_states_tt
#            # Uzbekistan
#            custom_effect_tooltip = form_country_uzbekistan_coring_states_tt
#            # Turkmenistan
#            custom_effect_tooltip = form_country_turkmenistan_coring_states_tt
#            # Tajikistan
#            custom_effect_tooltip = form_country_tajikistan_coring_states_tt
#            # Kyrgyzstan
#            custom_effect_tooltip = form_country_kyrgyzstan_coring_states_tt
#            #Uyguristan - Sinkiang
#            custom_effect_tooltip = form_country_sinkiang_coring_states_tt
#            654 = { add_core_of = ROOT }
##            329 = { add_core_of = ROOT }
#
#            ROOT = {
#                add_state_claim = 40
#                add_state_claim = 570
#
#                add_state_claim = 569
#                add_state_claim = 572
#                add_state_claim = 582
#                add_state_claim = 651
#
#                add_state_claim = 652
#                add_state_claim = 251
#                add_state_claim = 249
#
#                add_state_claim = 401
#                add_state_claim = 236
#            }
#            add_ideas = generic_recent_political_unification
#            add_ideas = generic_recent_army_unification
#            add_ideas = generic_recent_economic_unification
#            hidden_effect = {
#                #news_event = { id = wtt_news.1003 hours = 6 }
#                #country_event = { id = armenia.28 days = 2 }
#                set_global_flag = turkestan_formed
#            }
#        }
#
#        ai_will_do = {
#            factor = 200
#            modifier = {
#                factor = 0
#                is_historical_focus_on = yes
#            }
#        }
#    }
#}

form_nation_mod_category = {
	assimilate_chiapas = {

		icon = generic_nationalism

		cost = 25

		fire_only_once = yes

		days_remove = 60

		allowed = {
			OR = {
				original_tag = GUA
				original_tag = ELS
				original_tag = HON
				original_tag = NIC
				original_tag = COS
			}
		}

		highlight_states = {
			highlight_state_targets = {
                state = 475
			}
		}

		available = {
			has_civil_war = no
            has_completed_focus = USC_UNIFIED_central_american_unification
			475 = {
                compliance > 25
				is_controlled_by = ROOT
			}
		}

		visible = {
			has_cosmetic_tag = USC_UNIFIED
            475 = {
                NOT = {
					is_core_of = ROOT
				}
            }
		}

        modifier = {
            political_power_factor = -0.10
            resistance_damage_to_garrison = 0.05
            resistance_growth = 0.05
        }

		remove_effect = {
			475 = {
				add_core_of = ROOT
			}
		}

		ai_will_do = {
			factor = 50
		}		
	}
    assimilate_yucatan = {

		icon = generic_nationalism

		cost = 25

		fire_only_once = yes

		days_remove = 60

		allowed = {
			OR = {
				original_tag = GUA
				original_tag = ELS
				original_tag = HON
				original_tag = NIC
				original_tag = COS
			}
		}

		highlight_states = {
			highlight_state_targets = {
                state = 474
			}
		}

		available = {
			has_civil_war = no
            has_completed_focus = USC_UNIFIED_central_american_unification
			474 = {
                compliance > 25
				is_controlled_by = ROOT
			}
		}

		visible = {
			has_cosmetic_tag = USC_UNIFIED
            474 = {
                NOT = {
					is_core_of = ROOT
				}
            }
		}

        modifier = {
            political_power_factor = -0.10
            resistance_damage_to_garrison = 0.05
            resistance_growth = 0.05
        }

		remove_effect = {
			474 = {
				add_core_of = ROOT
			}
		}

		ai_will_do = {
			factor = 50
		}		
	}
	assimilate_panama = {

		icon = generic_nationalism

		cost = 35

		fire_only_once = yes

		days_remove = 60

		allowed = {
			OR = {
				original_tag = GUA
				original_tag = ELS
				original_tag = HON
				original_tag = NIC
				original_tag = COS
			}
		}

		highlight_states = {
			highlight_state_targets = {
                state = 937
                state = 304
			}
		}

		available = {
			has_civil_war = no
            has_completed_focus = USC_UNIFIED_central_american_unification
			937 = {
                compliance > 25
				is_controlled_by = ROOT
			}
            304 = {
                compliance > 25
				is_controlled_by = ROOT
            }
		}

		visible = {
			has_cosmetic_tag = USC_UNIFIED
            937 = {
                NOT = {
					is_core_of = ROOT
				}
            }
            304 = {
                NOT = {
					is_core_of = ROOT
				}
            }
		}

        modifier = {
            political_power_factor = -0.10
            resistance_damage_to_garrison = 0.05
            resistance_growth = 0.05
        }

		remove_effect = {
			937 = {
				add_core_of = ROOT
			}
            307 = {
				add_core_of = ROOT
			}
            685 = {
				add_core_of = ROOT
			}
		}

		ai_will_do = {
			factor = 50
		}		
	}

	integrate_greater_morocco = {

		icon = generic_form_nation

		allowed = {
			original_tag = MOR
		}

		available = {
			# West Sahara and mauritania
			controls_state = 699
			controls_state = 557
			controls_state = 786
		}

		visible = {
			original_tag = MOR
			NOT = { has_country_flag = country_formed_greater_morocco }

		}

		complete_effect = {

			# Greater morocco
			699 = { add_core_of = ROOT }
			557 = { add_core_of = ROOT }
			786 = { add_core_of = ROOT }
               add_political_power = 50
               add_stability = -0.05
               add_ideas = generic_recent_political_unification
			add_ideas = generic_recent_army_unification
			add_ideas = generic_recent_economic_unification

			hidden_effect = {
				set_country_flag = country_formed_greater_morocco
			}
		}

		ai_will_do = {
			factor = 200
		}
	}

    form_la_plata = {
        fire_only_once = yes
        icon = generic_form_nation

        allowed = {
            OR = {
                original_tag = BOL
                original_tag = ARG
                original_tag = URG
                original_tag = PAR
                original_tag = CHL
            }

        }
        visible = {
            if = {
                limit = {
                    original_tag = CHL
                }
                NOT = { has_country_flag = r56_hide_formables }
            }
        }
        available = { #Argentina, Uruguay, Paraguay
            all_state = {
                OR = {
                    NOT = { is_core_of = ARG }
                    is_controlled_by = ROOT
                }
            }
            all_state = {
                OR = {
                    NOT = { is_core_of = URG }
                    is_controlled_by = ROOT
                }
            }
            all_state = {
                OR = {
                    NOT = { is_core_of = PAR }
                    is_controlled_by = ROOT
                }
            }
        }
        complete_effect = {
            set_cosmetic_tag = PLA
            if = {
                limit = {
                    278 = { is_capital = no }
                }
                set_capital = { state = 278 }
            }
            hidden_effect = {
                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = BOL
                                    has_nationality = ARG
                                    has_nationality = URG
                                    has_nationality = PAR
                                    has_nationality = CHL                                    
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }
                every_state = { #This has a day of lag, for some reason.
                    limit = { OR = { is_core_of = ARG is_core_of = PAR is_core_of = URG } }
                    add_core_of = PREV #ROOT
                }
                add_state_core = 506
                news_event = { id = r56.news_event.36 hours = 6 }
            }
            add_state_claim = 299
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 50
        }
    }

    form_west_african_union = {

        fire_only_once = yes

        icon = generic_form_nation

        allowed = {
            OR = {
				tag = MRT
				tag = GAM
				tag = MLI
				tag = GNB
				tag = GNA
				tag = SIE
				tag = LIB
				tag = IVO
				tag = VOL
				tag = GHA
				tag = TOG
				tag = DAH
				tag = NGR
				tag = NGA
				tag = BIA
				tag = SOK # ideally should be able to make a caliphate and core islamic africa
			}
        }

        visible = {
            NOT = {
                has_cosmetic_tag = ARA_UNIFIED
                has_cosmetic_tag = MALI_UNITED
            }
        }

        available = {
            is_subject = no
           	controls_state = 557
			controls_state = 272
			controls_state = 701
			controls_state = 296
			controls_state = 780
            controls_state = 899
            controls_state = 898
            controls_state = 556
            controls_state = 700
            controls_state = 298
            controls_state = 779
            controls_state = 778
            controls_state = 274
            controls_state = 777
            controls_state = 776
            controls_state = 781
            controls_state = 902
            controls_state = 558
            controls_state = 900
            controls_state = 901
        }

        highlight_states = {
            highlight_state_targets = {
                state = 557
                state = 272
                state = 701
                state = 296
                state = 780
                state = 899
                state = 898
                state = 556
                state = 700
                state = 298
                state = 779
                state = 778
                state = 274
                state = 777
                state = 776
                state = 781
                state = 902
                state = 558
                state = 900
                state = 901
            }
        }

        complete_effect = {
            set_cosmetic_tag = WAU_UNITED
            hidden_effect = {
                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = MRT
                                    has_nationality = GAM
                                    has_nationality = MLI
                                    has_nationality = GNB
                                    has_nationality = GNA
                                    has_nationality = SIE
                                    has_nationality = LIB
                                    has_nationality = IVO
                                    has_nationality = VOL
                                    has_nationality = GHA
                                    has_nationality = TOG
                                    has_nationality = DAH
                                    has_nationality = NGR
                                    has_nationality = NGA                                
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }
                every_state = { #This has a day of lag, for some reason.
                    limit = {
                        OR = {
                            state = 557
                            state = 272
                            state = 701
                            state = 296
                            state = 780
                            state = 899
                            state = 898
                            state = 556
                            state = 700
                            state = 298
                            state = 779
                            state = 799
                            state = 778
                            state = 274
                            state = 777
                            state = 776
                            state = 781
                            state = 902
                            state = 558
                            state = 900
                            state = 901
                            state = 786 # Sahara
                            state = 782 # Sahara
                            state = 515 # Sahara
                        }
                    }
                    add_core_of = ROOT
                }
                news_event = { id = r56.news_event.37 hours = 6 }
            }
            add_state_claim = 699
            custom_effect_tooltip = form_country_gs_required_coring_states_tt
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 500
        }
    }
    
    reform_the_empire_of_mali = {

        fire_only_once = yes

        icon = generic_form_nation

        allowed = {
           original_tag = MLI
        }

        visible = {
            NOT = {
                has_cosmetic_tag = WAU_UNITED
            }
        }

        available = { #
            is_subject = no
            has_completed_focus = WAF_continue_expansion
            controls_state = 898
            controls_state = 556
            controls_state = 899
            controls_state = 272
            controls_state = 701
            controls_state = 557
        }

        highlight_states = {
            highlight_state_targets = {
                state = 898
                state = 556
                state = 899
                state = 272
                state = 701
                state = 557
            }
        }

        complete_effect = {
            set_cosmetic_tag = MALI_UNITED
            hidden_effect = {
                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = MLI
                                    has_nationality = SEN
                                    has_nationality = GAM
                                    has_nationality = MRT
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }
                every_state = { #This has a day of lag, for some reason.
                    limit = {
                        OR = {
                            state = 898
                            state = 556
                            state = 899
                            state = 272
                            state = 701
                            state = 557
                        }
                    }
                    add_core_of = ROOT
                }
                news_event = { id = r56.news_event.37 hours = 6 }
            }
            add_state_claim = 699
            custom_effect_tooltip = form_country_gs_required_coring_states_tt
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 50
        }
    }

#    form_east_african_union = { # mmh be sure that BBA east african union works
#        fire_only_once = yes
#        icon = generic_form_nation
#
#        allowed = {
#            OR = {
#                original_tag = UGA
#                original_tag = TZN
#                original_tag = KEN
#                original_tag = BRD
#                original_tag = RWA
#                original_tag = SSU
#            }
#
#        }
#        visible = {
#
#        }
#        available = { #Argentina, Uruguay, Paraguay
#            all_state = {
#                OR = {
#                    NOT = { is_core_of = UGA }
#                    is_controlled_by = ROOT
#                }
#            }
#            all_state = {
#                OR = {
#                    NOT = { is_core_of = TZN }
#                    is_controlled_by = ROOT
#                }
#            }
#            all_state = {
#                OR = {
#                    NOT = { is_core_of = KEN }
#                    is_controlled_by = ROOT
#                }
#            }
#            all_state = {
#                OR = {
#                    NOT = { is_core_of = BRD }
#                    is_controlled_by = ROOT
#                }
#            }
#            all_state = {
#                OR = {
#                    NOT = { is_core_of = RWA }
#                    is_controlled_by = ROOT
#                }
#            }
#        }
#        complete_effect = {
#            set_cosmetic_tag = EAU_UNITED
#            #if = {
#            #    limit = {
#            #        278 = { is_capital = no }
#            #    }
#            #    set_capital = 278
#            #}
#            hidden_effect = {
#                every_state = { #This has a day of lag, for some reason.
#                    limit = {
#                        OR = {
#                            is_core_of = UGA
#                            is_core_of = TZN
#                            is_core_of = KEN
#                            is_core_of = BRD
#                            is_core_of = RWA
#                        }
#                    }
#                    add_core_of = PREV #ROOT
#                }
#                news_event = { id = r56.news_event.37 hours = 6 }
#            }
#            add_ideas = generic_recent_political_unification
#            add_ideas = generic_recent_army_unification
#            add_ideas = generic_recent_economic_unification
#        }
#
#        ai_will_do = {
#            factor = 50
#        }
#    }

    reunite_germany = {
        days_re_enable = 0

        allowed = {
            OR = {
                original_tag = WGR
                original_tag = DDR
                original_tag = SAX
                original_tag = HAN
                original_tag = MEK
                original_tag = SHL
                original_tag = WUR
                original_tag = PRE
                original_tag = BAY
                original_tag = BAD
                original_tag = DNZ
                original_tag = SAR
                original_tag = VGE
				original_tag = RHI
				original_tag = THU
            }
        }
        visible = {
            NOT = {
                country_exists = GER
            }
        }
        fire_only_once = yes
        available = {
            is_subject = no
            42 = { is_controlled_by = ROOT }
            1053 = { is_controlled_by = ROOT }
            50 = { is_controlled_by = ROOT }
            51 = { is_controlled_by = ROOT }
            52 = { is_controlled_by = ROOT }
            53 = { is_controlled_by = ROOT }
            54 = { is_controlled_by = ROOT }
            55 = { is_controlled_by = ROOT }
            56 = { is_controlled_by = ROOT }
            57 = { is_controlled_by = ROOT }
            58 = { is_controlled_by = ROOT }
            998 = { is_controlled_by = ROOT }
            59 = { is_controlled_by = ROOT }
            989 = { is_controlled_by = ROOT }
            922 = { is_controlled_by = ROOT }
            923 = { is_controlled_by = ROOT }
            #DDR IRL
            60 = { is_controlled_by = ROOT }
            61 = { is_controlled_by = ROOT }
            62 = { is_controlled_by = ROOT }
            64 = { is_controlled_by = ROOT }
            65 = { is_controlled_by = ROOT }
            #119 = { is_controlled_by = ROOT }
        }
        icon = generic_form_nation
        complete_effect = { #Region 7: 42, 50, 51, 52, 53, 54, 55, 989, 922, 923
            every_state = {
                limit = { region = 7 }
                add_core_of = ROOT
            }

            56 = { add_core_of = ROOT }
            57 = { add_core_of = ROOT }
            58 = { add_core_of = ROOT }
            998 = { add_core_of = ROOT }
            59 = { add_core_of = ROOT }
            1053 = { add_core_of = ROOT }

            60 = { add_core_of = ROOT }
            61 = { add_core_of = ROOT }
            62 = { add_core_of = ROOT }
            64 = { add_core_of = ROOT }
            65 = { add_core_of = ROOT }
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
            set_country_flag = reunited_germany
            set_global_flag = global_reunited_germany
            set_cosmetic_tag = GER_REUNITED
            set_capital = { state = 64 }
            hidden_effect = {
                news_event = { id = r56.news_event.39 hours = 6 }

                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {

                                    has_nationality = WGR
                                    has_nationality = DDR
                                    has_nationality = SAX
                                    has_nationality = HAN
                                    has_nationality = MEK
                                    has_nationality = SHL
                                    has_nationality = WUR
                                    has_nationality = PRE
                                    has_nationality = BAY
                                    has_nationality = BAD
                                    has_nationality = DNZ
                                    has_nationality = VGE
									has_nationality = RHI
									has_nationality = THU
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }

            }
        }
        ai_will_do = {
            factor = 50
        }
    }

    reintegrate_lands_beyond_the_oder_neisse_line = {
        days_re_enable = 0

        allowed = {
            OR = {
                original_tag = WGR
                original_tag = SAX
                original_tag = HAN
                original_tag = MEK
                original_tag = SHL
                original_tag = WUR
                original_tag = BAY
                original_tag = BAD
                original_tag = DNZ
				original_tag = RHI
				original_tag = THU		
            }
        }
        visible = { has_country_flag = reunited_germany }
        fire_only_once = yes
        available = {
            is_subject = no
            63 = { is_controlled_by = ROOT }
            66 = { is_controlled_by = ROOT }
            67 = { is_controlled_by = ROOT }
            68 = { is_controlled_by = ROOT }
            5 = { is_controlled_by = ROOT }
            763 = { is_controlled_by = ROOT }
        }
        icon = generic_form_nation
        complete_effect = {
            every_state = {
                limit = { region = 8 NOT = { is_core_of = ROOT } }
                add_core_of = ROOT
            }
            5 = { add_core_of = ROOT }
            763 = { add_core_of = ROOT }
        }
        ai_will_do = {
            factor = 50
        }
    }
#	DNZ_join_germany = { #Should work but somehow when Germany gains Danzig they Gdynia automatically, check r56_on_action on state control change
#
#		icon = ger_reichskommissariats
#
#		allowed = {
#			tag = DNZ
#		}
#
#		available = {
#            AND = {
#                GER = {
#                    has_government = ROOT
#                    OR = {
#                        controls_state = 807
#                        controls_state = 763
#                    }
#                    is_puppet = no
#                }
#                OR = {
#                    is_puppet = no
#                    is_puppet_of = GER
#                    AND = {
#                        is_puppet = yes
#                        OVERLORD = {
#                            has_war_with = GER
#                        }
#                    }
#                }
#            }
#
#
#		}
#        cost = 20
#		visible = {
#			tag = DNZ
#		}
#		days_remove = 25
#		complete_effect = {
#
#		}
#
#		remove_effect = {
#
#            POL = { country_event = { id = danzig.6 hours = 1 } }
#
#            GER = {
#                if = {
#                    limit = {
#                        DNZ = {
#                            owns_state = 85
#                        }
#
#                    }
#                    transfer_state = 85
#                    85 = {	add_core_of = GER }
#                }
#                if = {
#                    limit = {
#                        DNZ = {
#                            owns_state = 807
#                        }
#                    }
#                    transfer_state = 807
#                    807 = {	add_core_of = GER }
#                }
#			}
#		}
#
#		ai_will_do = {
#			factor = 200
#		}
#	}
    form_idel_ural = {
        icon = generic_form_nation
        fire_only_once = yes
        allowed = { original_tag = TAT }

        available = {
            is_subject = no
            controls_state = 652
            controls_state = 251
            controls_state = 651
            controls_state = 582
            controls_state = 401
        }

        complete_effect = {
            652 = { add_core_of = ROOT }
            251 = { add_core_of = ROOT }
            651 = { add_core_of = ROOT }
            582 = { add_core_of = ROOT }
            401 = { add_core_of = ROOT }
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
            set_country_flag = reunited_idel_ural
            set_cosmetic_tag = IDEL_URAL

        }

        ai_will_do = {
            factor = 200
        }
    }


    form_sardinia_piedmont = {
        icon = generic_form_nation
        fire_only_once = yes
        allowed = { original_tag = SAD }

        available = {
            is_subject = no
            controls_state = 114
            controls_state = 158
        }

        visible = {
            NOT = {
                has_cosmetic_tag = ITA_REBORN
            }
        }

        complete_effect = {
            158 = { add_core_of = ROOT }

            set_country_flag = formed_sardinia_piedmont
            set_cosmetic_tag = SAD_PIEDMONT
        }

        ai_will_do = {
            factor = 200
        }
    }

	reunite_italy = {

		icon = generic_form_nation

		allowed = {

			OR = {
                original_tag = SIC
                original_tag = SAD
                original_tag = VNZ
                original_tag = NAP
                original_tag = TTS
                original_tag = TOS
                original_tag = LBV
                original_tag = PAP
			}
		}

		available = {
			is_subject = no
			NOT = {
				has_idea = generic_recent_political_unification
				has_idea = generic_recent_army_unification
				has_idea = generic_recent_economic_unification
			}
			# Italy
			custom_trigger_tooltip = {
				tooltip = form_eu_italy_required_states_tt
				controls_state = 158
				controls_state = 159
				controls_state = 39
				controls_state = 160
				controls_state = 161
				controls_state = 162
				controls_state = 157
				controls_state = 2
				controls_state = 117
				controls_state = 114
				controls_state = 156
				controls_state = 115
				controls_state = 736
				controls_state = 163
            }
            NOT = {
                country_exists = ITA
            }
		}

        fire_only_once = yes

		visible = {


		}

		complete_effect = {
			# Italy
			custom_effect_tooltip = form_eu_italy_coring_states_tt
			hidden_effect = {
				158 = { add_core_of = ROOT }
				159 = { add_core_of = ROOT }
				39 = { add_core_of = ROOT }
				160 = { add_core_of = ROOT }
				161 = { add_core_of = ROOT }
				162 = { add_core_of = ROOT }
				157 = { add_core_of = ROOT }
				2 = { add_core_of = ROOT }
				117 = { add_core_of = ROOT }
				156 = { add_core_of = ROOT }
				115 = { add_core_of = ROOT }
				736 = { add_core_of = ROOT }
				163 = { add_core_of = ROOT }
				114 = { add_core_of = ROOT }
				912 = { add_core_of = ROOT }
				911 = { add_core_of = ROOT }
        850 = { add_core_of = ROOT }				
				set_global_flag = italy_reborn
            }
            if = {
                limit = {
                    original_tag = NAP
                }
                set_cosmetic_tag = ITA_REBORN_NAP
            }
            if = {
                limit = {
                    original_tag = SAD
                }
                set_cosmetic_tag = ITA_REBORN_SAD
            }
            if = {
                limit = {
                    original_tag = SIC
                }
                set_cosmetic_tag = ITA_REBORN_SIC
            }
            if = {
                limit = {
                    original_tag = VNZ
                }
                set_cosmetic_tag = ITA_REBORN_VNZ
            }
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
		}

		ai_will_do = {
			factor = 200
		}
	}

    unite_the_cossack_hosts = {
        icon = generic_form_nation
        fire_only_once = yes
        allowed = {
            OR = {
                original_tag = DON
                original_tag = KUB
            }
        }
        visible = {
            NOT = {
                has_cosmetic_tag = COSSACKS_UNITED
            }
        }
        available = {
        #   is_subject = no
            controls_state = 218
            controls_state = 245
            controls_state = 265
            controls_state = 217
            controls_state = 238

            controls_state = 234
            controls_state = 235
            controls_state = 233
        #    controls_state = 232
        }

        complete_effect = {
            218 = { add_core_of = ROOT }
            245 = { add_core_of = ROOT }
            265 = { add_core_of = ROOT }
            217 = { add_core_of = ROOT }
            238 = { add_core_of = ROOT }

            234 = { add_core_of = ROOT }
            233 = { add_core_of = ROOT }
            235 = { add_core_of = ROOT }
        #    232 = { add_core_of = ROOT }

            set_cosmetic_tag = COSSACKS_UNITED

            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
            set_country_flag = cossacks_united
        }

        ai_will_do = {
            factor = 200
        }
    }
    form_a_dravidian_state = { # Revise those cores slightly in the future. Is Goa relevant? Should Andhra 424 be included?
        # Dravidar Kazhagam leader of the Dravidian unification movement as part of the Justice party in India - soc dem.
        # S. P. Adithanar was in Singapore before 1942 but was clearly militant later in life. Closest thing to a fascist?
        icon = generic_form_nation
        fire_only_once = yes
        allowed = { 
			OR = {
				original_tag = SRL 
				original_tag = RAS
				original_tag = MYS
			}
		}
		highlight_states = {
			highlight_state_targets = {
                state = 422
				state = 423
				state = 424
				state = 425
				state = 1098
			}
		}
        available = {
            is_subject = no
            422 = {
                is_fully_controlled_by = ROOT
            }
            423 = {
                is_fully_controlled_by = ROOT
            }
            424 = {
                is_fully_controlled_by = ROOT
            }
            425 = {
                is_fully_controlled_by = ROOT
            }
            1098 = {
                is_fully_controlled_by = ROOT
            }
        }

        complete_effect = {
            320 = { add_core_of = ROOT }
            #321 = { add_core_of = ROOT }
            422 = { add_core_of = ROOT }
            423 = { add_core_of = ROOT }
            424 = { add_core_of = ROOT }
            425 = { add_core_of = ROOT }
			1098 = { add_core_of = ROOT }
			#1099 = { add_core_of = ROOT }
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
            set_country_flag = dravidian_united
            set_cosmetic_tag = DRAVIDIAN_UNITED
        }

        ai_will_do = {
            factor = 200
        }
    }

    #### FINALIZE UNIFICATION ####
    political_unification = {
        visible = {
            has_idea = generic_recent_political_unification
        }
        # fire_only_once = yes
        available = { 
            has_idea = generic_recent_political_unification
        }

        priority = 10 # so it appears at the top always for cleaner aesthetics

        icon = generic_political_discourse

        cost = 75

        days_remove = 90

        modifier = {
            drift_defence_factor = -0.25
            political_power_factor = -0.05
            stability_weekly = -0.001
        }

        remove_effect = {
            remove_ideas = generic_recent_political_unification
        }

        ai_will_do = {
            factor = 50
        }
    }

    army_unification = {
        visible = {
            has_idea = generic_recent_army_unification
        }
        # fire_only_once = yes
        available = {
            has_idea = generic_recent_army_unification
        }

        priority = 10 # so it appears at the top always for cleaner aesthetics

        icon = generic_army_support
        days_remove = 90

        modifier = {
            military_leader_cost_factor = 0.25
            command_power_gain = -0.15
            army_org_factor = -0.05
            army_morale_factor = -0.10
        }

        custom_cost_text = decision_cost_CP_25_pp_25_ArmXP_10

        custom_cost_trigger = {
            command_power > 24
            has_political_power > 24
            has_army_experience > 9
        }

        complete_effect = {
            hidden_effect = {
                add_command_power = -25
                add_political_power = -25
                army_experience = -10
            }
        }

        remove_effect = {
            remove_ideas = generic_recent_army_unification
        }

        ai_will_do = {
            factor = 50
        }
    }

    economic_unification = {
        visible = {
            has_idea = generic_recent_economic_unification
        }
        #fire_only_once = yes
        available = {
            has_idea = generic_recent_economic_unification
        }

        priority = 10 # so it appears at the top always for cleaner aesthetics

        icon = generic_factory
        
        cost = 75

        days_remove = 90

        modifier = {
            consumer_goods_factor = 0.05
            production_speed_buildings_factor = -0.05
            production_factory_efficiency_gain_factor = -0.10
        }

        remove_effect = {
            remove_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 50
        }
    }
}

form_arabia_category = {
    assert_control_over_the_holy_sites = {
        icon = generic_form_nation
        fire_only_once = yes
        cost = 25
        days_remove = 90

        allowed = {
            OR = {
                original_tag = ADU
                original_tag = MOR
                original_tag = ALG
                original_tag = TUN
                original_tag = EGY
                original_tag = PAL
                original_tag = SUD
                original_tag = SOM
                original_tag = SYR
                original_tag = TUR
                original_tag = PAL
                original_tag = JOR
                #original_tag = IMA #what is this tag?
                original_tag = IRQ
                original_tag = PER
                original_tag = PAK
                original_tag = AZR
                original_tag = XSM
                original_tag = SIK
                original_tag = KAZ
                original_tag = INS
                original_tag = LBA
                original_tag = KUW
                original_tag = BOS
                original_tag = MLD
                original_tag = MLI
                original_tag = LEB
                original_tag = KYR
                original_tag = MRT
                original_tag = TAJ
                original_tag = TMS
                original_tag = CRI
                original_tag = UZB
                original_tag = BAN
                original_tag = ALB
            }
        }

        visible = {
            NOT = { has_government = communism }
            controls_state = 679
        }

        available = {
            controls_state = 679
        }

        ai_will_do = {
            factor = 50
        }

        complete_effect = { }

        remove_effect = {
            add_stability = 0.05
        }
    }
}

form_hispanoamerica_category = {
    form_hispanoamerica = {
        icon = generic_form_nation

        allowed = {
            OR = {
                original_tag = ARG
                original_tag = ECU
                original_tag = PAR
                original_tag = CHL
                original_tag = COL
                original_tag = PAN
                original_tag = BOL
                original_tag = URG
                original_tag = VEN
            }
            is_ai1 = yes
        }
        fire_only_once = yes
        available = {
        
            any_state = {
                AND = {
                    is_core_of = ARG
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = ECU
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = CHL
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = COL
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = PAN
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = PRU
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = BOL
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = URG
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = VEN
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = PAR
                    is_controlled_by = ROOT
                }
            }
        }

        complete_effect = {
            set_cosmetic_tag = HIS_UNIFIED
            every_state = {
                limit = {
                    OR = {
                        is_core_of = ARG is_core_of = ECU is_core_of = PAR is_core_of = CHL is_core_of = COL is_core_of = PAN is_core_of = PRU is_core_of = BOL is_core_of = URG is_core_of = VEN is_core_of = ELS is_core_of = COS is_core_of = GUA is_core_of = HON is_core_of = NIC is_core_of = MEX is_core_of = CUB is_core_of = DOM
                        state = 311 #Belize
                        state = 686 #Puerto Rico
                        state = 695 #Curação
                    }
                }
                add_core_of = PREV
            }

            every_state = {
                limit = {
                    OR = {
                        region = 53 is_core_of = BAH #Caribbean + Bahamas
                        state = 366 state = 375 state = 376 state = 377 state = 378 state = 379 state = 380 state = 382 #Mexican old clay
                        state = 687 state = 299 state = 720 state = 502 state = 503 #Historical claims
                    }
                    NOT = { is_core_of = ROOT }
                }
                add_claim_by = ROOT
            }

            hidden_effect = {
                news_event = { id = r56.news_event.18 hours = 6 }
                set_global_flag = form_hispanomerica_flag

                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = ARG
                                    has_nationality = ECU
                                    has_nationality = PAR
                                    has_nationality = CHL
                                    has_nationality = COL
                                    has_nationality = PAN
                                    has_nationality = BOL
                                    has_nationality = URG
                                    has_nationality = VEN
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }
            }

            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 200
            modifier = {
                factor = 0
                is_historical_focus_on = yes
            }
        }
    }

    core_mexican_america = {
        fire_only_once = yes
        available = {
			378 = {
				is_fully_controlled_by = ROOT
				compliance > 50
			}
			379 = {
				is_fully_controlled_by = ROOT
				compliance > 50
			}
			377 = {
				is_fully_controlled_by = ROOT
				compliance > 50
			}
			376 = {
				is_fully_controlled_by = ROOT
				compliance > 50
			}
            382 = {
				is_fully_controlled_by = ROOT
				compliance > 50
			}
			380 = {
				is_fully_controlled_by = ROOT
				compliance > 50
			}
			375 = {
				is_fully_controlled_by = ROOT
				compliance > 50
			}
        }
        cost = 100
        days_remove = 120
        visible = {
            has_cosmetic_tag = HIS_UNIFIED
        }
		highlight_states = {
			highlight_state_targets = {
				state = 378
                state = 379
                state = 377
                state = 376
                state = 382
                state = 380
                state = 375
			}
		}
        complete_effect = {
            every_state = {
                limit = {
                    OR = {
                        state = 366 state = 375 state = 376 state = 377 state = 378 state = 379 state = 380 state = 382 #Mexican old clay
                    }
                }
                add_resistance = 15
            }
        }
		remove_effect = {
            366 = { add_core_of = ROOT }
            375 = { add_core_of = ROOT }
            376 = { add_core_of = ROOT }
            377 = { add_core_of = ROOT }
            378 = { add_core_of = ROOT }
            379 = { add_core_of = ROOT }
            380 = { add_core_of = ROOT }
            382 = { add_core_of = ROOT }
            hidden_effect = {
                remove_state_claim = 366
                remove_state_claim = 375
                remove_state_claim = 376
                remove_state_claim = 377
                remove_state_claim = 378
                remove_state_claim = 379
                remove_state_claim = 380
                remove_state_claim = 382
            }
		}
        ai_will_do = {
            factor = 200
        }
    }
}


form_pru_hispanoamerica_category = {    #seperated to use a different name etc
    form_pru_hispanoamerica = {
        icon = generic_form_nation

        allowed = {
                original_tag = PRU   
                is_ai1 = yes
        }
        fire_only_once = yes
        available = {
            OR = {
                has_completed_focus = PRU_hispanism     #only for very Spanish-embracing people
                has_completed_focus = PRU_our_revolution
            }
        
            any_state = {
                AND = {
                    is_core_of = ARG
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = ECU
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = CHL
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = COL
                    is_controlled_by = ROOT
                }
            }     
            any_state = {
                AND = {
                    is_core_of = PRU
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = BOL
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = URG
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = VEN
                    is_controlled_by = ROOT
                }
            }
            any_state = {
                AND = {
                    is_core_of = PAR
                    is_controlled_by = ROOT
                }
            }
        }

        complete_effect = {
            set_cosmetic_tag = HIS_UNIFIED_PRU
            every_state = {
                limit = {
                    OR = {
                        is_core_of = ARG is_core_of = ECU is_core_of = PAR is_core_of = CHL is_core_of = COL is_core_of = PAN is_core_of = PRU is_core_of = BOL is_core_of = URG is_core_of = VEN is_core_of = ELS is_core_of = COS is_core_of = GUA is_core_of = HON is_core_of = NIC is_core_of = MEX is_core_of = CUB is_core_of = DOM
                        state = 311 #Belize
                        state = 686 #Puerto Rico
                        state = 695 #Curação
                    }
                }
                add_core_of = PREV
            }

            every_state = {
                limit = {
                    OR = {
                        region = 53 is_core_of = BAH #Caribbean + Bahamas
                        state = 366 state = 375 state = 376 state = 377 state = 378 state = 379 state = 380 state = 382 #Mexican old clay
                        state = 687 state = 299 state = 720 state = 502 state = 503 #Historical claims
                    }
                    NOT = { is_core_of = ROOT }
                }
                add_claim_by = ROOT
            }

            hidden_effect = {
                news_event = { id = r56.news_event.18 hours = 6 }
                set_global_flag = form_hispanomerica_flag
            }

            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 200
            modifier = {
                factor = 0
                is_historical_focus_on = yes
            }
        }
    }
}

reform_the_mamluks_category = {
    reform_the_mamluks = {
        icon = generic_form_nation
        fire_only_once = yes

        allowed = {
            OR = {
                original_tag = EGY
                original_tag = PAL
                original_tag = LBA
                original_tag = LEB
                original_tag = SYR
            }
        }

        visible = {
            NOT = { has_government = communism }
        }

        available = {
            is_subject = no
            custom_trigger_tooltip = {
                tooltip = form_country_mamluks_no_arabia_tt
                NOT = { has_cosmetic_tag = ARA_UNIFIED }
            }
            custom_trigger_tooltip = {
                tooltip = form_country_mamluks_required_states_egyptian_tt
                controls_state = 907
                controls_state = 911
                controls_state = 995
                controls_state = 447
                controls_state = 452
                controls_state = 456
                controls_state = 457
                controls_state = 453
            }
            custom_trigger_tooltip = {
                tooltip = form_country_mamluks_required_states_palestinian_tt
                controls_state = 454
                controls_state = 1016
                controls_state = 1017
                controls_state = 966
                controls_state = 949
            }
            custom_trigger_tooltip = {
                tooltip = form_country_mamluks_required_states_jordanian_tt
                controls_state = 455
                controls_state = 1021
                controls_state = 1022
            }
            custom_trigger_tooltip = {
                tooltip = form_country_mamluks_required_states_lebanese_tt
                controls_state = 553
            }
            custom_trigger_tooltip = {
                tooltip = form_country_mamluks_required_states_syrian_tt
                controls_state = 554
                controls_state = 677
                controls_state = 680
                controls_state = 799
            }
            controls_state = 855
            controls_state = 679
            controls_state = 344
            controls_state = 451
            controls_state = 663
            controls_state = 450
        }

        ai_will_do = {
            factor = 50
        }

        complete_effect = {
            custom_effect_tooltip = form_country_gs_required_coring_states_tt
            set_cosmetic_tag = MAM
            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
            hidden_effect = {

                if = {
                    limit = {
                        has_dlc = "La Resistance"
                    }
                    every_country = {
                        every_operative = {
                            limit = {
                                OR = {
                                    has_nationality = EGY
                                    has_nationality = PAL
                                    has_nationality = LBA
                                    has_nationality = LEB
                                    has_nationality = SYR
                                }
                                NOT = {
                                    has_nationality = ROOT
                                }
                            }
                            add_nationality = ROOT
                        }
                    }
                }


                add_state_core = 907
                add_state_core = 911
                add_state_core = 995
                add_state_core = 447
                add_state_core = 452
                add_state_core = 456
                add_state_core = 457
                add_state_core = 453
                add_state_core = 454
                add_state_core = 1016
                add_state_core = 1017
                add_state_core = 966
                add_state_core = 949
                add_state_core = 455
                add_state_core = 1021
                add_state_core = 1022
                add_state_core = 855
                add_state_core = 679
                add_state_core = 553
                add_state_core = 554
                add_state_core = 677
                add_state_core = 680
                add_state_core = 799
                add_state_core = 344
                add_state_core = 451
                add_state_core = 663
                add_state_core = 450
            }
        }
    }
}
#Alammania
EYE_form_alamannia_category = {
	SWI_form_alamannia = {

		icon = generic_form_nation

		allowed = {
			original_tag = SWI
            is_ai1 = yes
		}

		highlight_states = {
			highlight_state_targets = {
                state = 153
                state = 28
                state = 42
                state = 1053
                state = 50
                state = 52
                state = 53
                state = 54
			}
		}

		available = {
			is_subject = no
			controls_state = 153
			controls_state = 28
			controls_state = 42
            controls_state = 1053
			controls_state = 50
			controls_state = 52
			controls_state = 53
            controls_state = 1053
			controls_state = 54
			controls_state = 923
		}

		visible = {
			OR = {
				has_completed_focus = SWI_irredentism
				controls_state = 153
				controls_state = 28
				controls_state = 42
                controls_state = 1053
				controls_state = 50
				controls_state = 52
				controls_state = 53
				controls_state = 54
			}
			NOT = { has_global_flag = SWI_formed_alamannia }
		}

		complete_effect = {
			set_cosmetic_tag = SWI_alamannia
			add_state_core = 153
			add_state_core = 28
			add_state_core = 42
            add_state_core = 1053
			add_state_core = 50
			add_state_core = 52
			add_state_core = 53
			add_state_core = 54
			add_state_core = 923
			hidden_effect = {
				set_global_flag = SWI_formed_alamannia
			}
		}

		ai_will_do = {
			factor = 200
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}

form_nation_mod_category = {
    unite_tanganyika_zanzibar = {

		icon = generic_form_nation

		allowed = {
			OR = {
                original_tag = TZN
                original_tag = ZAN
            }
		}

		highlight_states = {
			highlight_state_targets = {
                state = 546
                state = 1055
			}
		}

		available = {
			is_subject = no
			controls_state = 546
			controls_state = 1055
		}

		visible = {
            OR = {
                has_government = democratic
                has_government = communism
                if = {
                    limit = {
                        original_tag = TZN
                    }
                    has_government = neutrality
                }
            }
			NOT = { has_global_flag = TZA_formed_tanzania }
            NOT = { has_cosmetic_tag = east_africa }
		}

		complete_effect = {
            add_stability = 0.05
			set_cosmetic_tag = TZA
			add_state_core = 546
			add_state_core = 1055
			hidden_effect = {
				set_global_flag = TZA_formed_tanzania
			}
		}

		ai_will_do = {
			factor = 75
			modifier = {
				factor = 250
				is_historical_focus_on = yes
			}
		}
	}

    form_greater_texas = {

		icon = generic_form_nation

		allowed = {
			original_tag = TXS
		}

		highlight_states = {
			highlight_state_targets = {
                state = 375
                state = 479
                state = 480
                state = 482
			}
		}

		available = {
			is_subject = no
			controls_state = 375
			controls_state = 479
            controls_state = 480
            controls_state = 482
		}

		visible = {
			NOT = { has_global_flag = TXS_formed_greater_texas }
		}

		complete_effect = {
			set_cosmetic_tag = TXS_greater
			add_state_core = 375
			add_state_core = 479
            add_state_core = 480
            add_state_core = 482
			hidden_effect = {
				set_global_flag = TXS_formed_greater_texas
			}
		}

		ai_will_do = {
			factor = 100
		}
	}
    form_inuit_union = {
        icon = generic_form_nation

        allowed = {

            original_tag = GRL
            
        }
		highlight_states = {
			highlight_state_targets = {
				state = 463
				state = 864
				state = 472
				state = 683
				state = 466
				state = 332
				state = 101
				state = 861
			}
		}        
        fire_only_once = yes
        available = {
            is_subject = no
            INU = {
				exists = no
			}
            count_triggers = {
                amount > 3
                controls_state = 101
                controls_state = 463 
                controls_state = 466
                controls_state = 864 
                controls_state = 472 
                controls_state = 683
                controls_state = 332
                controls_state = 861
            }

        }
        complete_effect = {
            set_cosmetic_tag = INU
            custom_effect_tooltip = form_country_inuit_required_coring_states_tt
            hidden_effect = {
                every_state = {
                    limit = {
                        OR = {
                            state = 463
                            state = 864
                            state = 472
                            state = 683
                            state = 466
                            state = 332
                            state = 101
                            state = 861
                        }
                    }
                    add_core_of = ROOT #ROOT
                }
                #news_event = { id = r56.news_event.34 hours = 6 }

 
            }
            add_war_support = 0.05

            add_ideas = generic_recent_political_unification
            add_ideas = generic_recent_army_unification
            add_ideas = generic_recent_economic_unification
        }

        ai_will_do = {
            factor = 200
            modifier = {
                factor = 0.1
                is_historical_focus_on = yes
            }
        }
    } 
}
