I'm trying to make a mod that allows the user to edit their character's sneak damage multiplier per weapon type through MCM. I'd give them an MCM Slider Option for each weapon type, so they could set 1x - 100x sneak damage. I plan on tying this to a perk in the place of Backstab.
I've gone through about four different implementations and I've hit a brick wall each time. My current attempt was to have the perk give the player an ability with the isSneaking conditional that ran an ActiveMagicEffect script. The script would check the type of weapon that the player had currently equipped and change the attackDamageMult Actor Value according to the MCM settings, because I couldn't find a way to use the sneak damage mult value outside of Perk Entries (which wouldn't work, because then I'd need to make a perk for every single combination, which is not feasible)
The problem I have now is that "is sneaking" really means "is crouched," because the function couldn't care less whether or not you're actually detected. This would mean that, after the initial sneak attack, the player would retain the damage multiplier as long as they remained crouching, which is obviously not what I intend. I've tried to add another conditional for GetDetection(), but that requires a target; I need to know if the player is detected by anything, not just a specific actor.
Does anyone have a fix for this implementation, or an idea for a better one?