I'm trying to create a follower that has a dynamic leveling system, i.e gains skill level+"perks"+buffs over time, which can be influenced by the player. The perks will be gained as the follower levels with the player and various permanent buffs will be applied through experience in combat. Since I'm new to modding, though, I don't know how exactly I would make the follower "level" like this. I understand that the actor can level dynamically according to the player level, and I'm thinking of using that option (the option in the Actor editing window) in terms of level growth. However, I don't know how to trigger certain events once the follower reaches a specific level or counter (e.g gaining a perk at level 5, bonus armor rating after taking x damage, etc.). For clarity, I plan on the level-associated perks being to be chosen through dialogue, and having the buffs apply after the specified amount of whatever is reached by the follower. Any suggestions on how I should do this?
tl;dr
I need help making a follower gain 1. perks through dialogue after hitting a certain level, and 2. buffs after certain things have been achieved (e.g overall damage/healing/time spent on fire/etc). Suggestions?