
    StartupEvents.registry('palladium:abilities', (event) => {
        event.create('heroes:genetic_stability_debuffs')
            .icon(palladium.createItemIcon('palladium:vibranium_circuit'))


			.lastTick((entity, entry, holder, enabled) => {
				if (enabled) {
					let UUID = "08a4b58d-446d-418f-bffa-8ec185812ff3";
					entity.removeAttribute("minecraft:generic.movement_speed", UUID)
					entity.removeAttribute("minecraft:generic.max_health", UUID)
					entity.removeAttribute("minecraft:generic.attack_damage", UUID)
					entity.removeAttribute("palladium:jump_power", UUID)
					}
					})
            .tick((entity, entry, holder, enabled) => {
                if (enabled) {
					let UUID = "08a4b58d-446d-418f-bffa-8ec185812ff3";
					let genetic_stability = palladium.getProperty(entity, "heroes:genetic_stability").toString()
					entity.removeAttribute("minecraft:generic.movement_speed", UUID)
					entity.removeAttribute("minecraft:generic.max_health", UUID)
					entity.removeAttribute("minecraft:generic.attack_damage", UUID)
					entity.removeAttribute("palladium:jump_power", UUID)
					if (genetic_stability < 60) {
					let genetic_levels_1 = -Math.abs((60 - (genetic_stability)) / 10)
					let genetic_levels = -Math.abs((60 - (genetic_stability)) / 50)
					if (genetic_levels_1 >= 9) {
						genetic_levels_1 = 9
					}
					entity.server.runCommandSilent("execute as " + entity.uuid + " at @s run scoreboard players add @s Heroes.Concentration.Hold " + Math.round(Math.abs(genetic_levels_1)) + "");
					entity.modifyAttribute("minecraft:generic.max_health", UUID, genetic_levels, "multiply_base")
					entity.modifyAttribute("minecraft:generic.movement_speed", UUID, genetic_levels, "multiply_base")
					entity.modifyAttribute("minecraft:generic.attack_damage", UUID, genetic_levels, "multiply_base")
					entity.modifyAttribute("palladium:jump_power", UUID, (genetic_levels / 2), "multiply_base")
					if (genetic_stability < 20) {
						if (!containsTag(entity.getTags().toArray(), "Heroes.Uncatalyzed")) {
							entity.server.runCommandSilent("execute as " + entity.uuid + " at @s run tag @s add Heroes.Uncatalyzed");
						}
					}
											}
					
					
                }
            });
    });



function containsTag(tags, tag) {
    for (let i = 0; i < tags.length; i++) {
        if(tags[i].equals(tag)) {
            return true;
        }
    }
    return false;
}