decline_of_mali = {
	ended_by_country_breaking_to_rebels = no
	potential = {
		has_dlc = "Origins"
		NOT = { has_country_flag = had_decline_of_mali }
		NOT = { has_country_flag = formed_mali_flag }	#A formed Mali should not go through a decline
		NOT = { mission_completed = mal_absolute_authority }
		uses_doom = no
		is_free_or_tributary_trigger = yes
		normal_or_historical_nations = yes
		tag = MAL
	}
	
	can_start = {
		has_any_disaster = no
		NOT = { mission_completed = mal_absolute_authority }
		
		#added
		OR = {
			started_in = 1337.1.1		#after death of Mansa Musa
			AND = {
				is_year = 1300				#MMETR
				NOT = { stability = -1 }
				OR = {
					NOT = { adm = 3 }
					NOT = { mil = 3 }
					NOT = { prestige = 0 }
				}
			}
		}
	}
	
	can_stop = { 
		has_any_disaster = yes
	}
	
	
	progress = {
		modifier = {
			factor = 100
			tag = MAL
		}
	}
	
	can_end = {
		mission_completed = mal_absolute_authority
	}
	

	modifier = {
		caravan_power = -0.33
		stability_cost_modifier = 0.15
		global_autonomy = 0.05
		global_unrest = 1
	}
	
	on_start = flavor_mal.9 # Mali is on the path of breaking apart
	on_end = flavor_mal.10 # Mali managed to retain authority
	
	on_monthly = {
		events = {
			flavor_mal.16
			flavor_mal.17
			flavor_mal.18
			flavor_mal.19
		}
		random_events = {
			1000 = 0
			100 = flavor_mal.11
			100 = flavor_mal.12
			100 = flavor_mal.13
			100 = flavor_mal.14
			100 = flavor_mal.15
			100 = flavor_mal.16
			100 = flavor_mal.17
			100 = flavor_mal.18
			100 = flavor_mal.19
			100 = flavor_mal.20
			100 = flavor_mal.21
			100 = flavor_mal.22
			100 = flavor_mal.23
		}
	}
}

