I am currently working on a small mod, in which I would like to grant the player character skill levels as part of scripted events. Easy enough, except that I would like these levels to count towards leveling up if the skills are major/minor, and to count for attribute multipliers at level up. Essentially, I would like the skill increases to function just like advancement in regular play. As far as I know, there are no functions designed to do this in a straightforward manner. I have come up with two possible solutions, but neither is perfect, so I thought I'd ask for advice here.
The first way I've considered doing this is to make the mod dependant on MWE, which adds a function to give the PC experience towards skill advancement. This would be simple, straightforward, and relatively seemless, but it has a few issues. First, the skill will never advance from experience given this way; the function can add up to 100% progress, but the player must use the skill normally to get the increase. This is minor, but potentially immersion-breaking ("You've learned a bit more about heavy armor... go let a rat bite you to increase your skill"). More seriously, as I understand it progress will put you up to 100% but never role over to the next level. This means that if the player is already 99% of the way to a skill increase the advancement given by my mod would be essentially worthless- they would gain 1%, rather than a 'full' level. This also means that no more than one level could ever be given at a time without the player using the skill between each advancement.
The other option would be for a script to place a tiny, invisible NPC behind the player, forcegreeting, and have this NPC offer training in the desired skill, then disappear. The script would add a pile of gold to the PC's inventory to pay for the training and then take away whatever's left afterwards. There are a couple of potential issues I can think of with this, but all are solveable. Off the top of my head, I'd have to set all of the NPC's other skills to 0 to prevent them from offering training in a different area, give the PC a temporary fortification to their attributes to allow them to train a skill over its governing attribute, and make sure the NPC can't chat with the player about generic topics. This would be a relatively complicated script given the simplicity of the task I'm trying to accomplish, but I think I could work it out so there are no possible negative gameplay effects. The main problem with this approach is that it would feel kind of jury-rigged.
Right now, I'm leaning towards the second approach- I'd like it to feel seemlessly integrated, but that's less important than having everything function properly. Plus I'd like to avoid dependance on MWE. However, if anyone has any suggestions on new ways to accomplish this, or ways to improve the above methods, I'd be grateful!
Thanks!