So we all know that there comes a point where the DPCT of casting a buffed dot makes it worth overwriting the unbuffed dot instead of casting Mind Flay. I haven't seen any math/sim work to say exactly how many ticks that is for how big a buff but we'll come to that. First off there are bigger problems, which is that even if you knew, keeping track of all your buffs, including those from boss gimmicks, is pretty tricky, and keeping track of which of your dots were cast with which of those buffs is next to impossible because your UI won't tell you and you're not a robot. We need an addon to help with that.
Awesomely, one of the authors of WeakAuras (like Power Auras Classic but better) posted some example custom code here for a couple of triggers that gives a framework for keeping track of that information. The first trigger is hidden and snapshots your toon's stats (int, mastery, haste, crit) at the point you cast a dot. The second trigger compares your toon's current stats to that snapshot and color codes a display showing whether they're greater or lesser than the snapshot value. All of which is great and shows what we need is very possible, but there are a few problems.
As it is the displayed information gives you values for int, mastery, haste and crit (and some more, like ticks left) for each dot you want to consider refreshing. For spriests on one target that would mean eight values to watch, four for DP and four for VT. This is clunky and makes displaying the info in your UI in an elegant way very difficult. Following an addon I saw mooted on shadowpriest.com a good suggestion seemed to be to use normalised stat weights to provide an overall int-equivalent delta summed from all your stats, which would give you one value to watch and find room for in your UI and one value to know how large it had to be to be worth overwriting. I like that as a solution as you could then display not even a value but a simple yes/no indicator if you should refresh or leave a dot to tick out and otherwise display nothing at all.
But then I figured that wouldn't work, for a few reasons. It doesn't take account of Dark Evangelism or Empowered Shadows, both of which operate independently of base stats and mastery can be "locked in" eg gaming Theralion's Mirror or Moonwell Chalice to extend the ES bonus. I think it would also double count int buffs through the crit and sp granted. What you really want to snapshot and track is the dot's actual damage value calculated from stats and all relevant buffs. This is possible but would require basically coding in a spreadsheet and updating for every hotfix and patch. Or you could scan tooltips and hope a hotfix hadn't made the value inaccurate, but I'm not sure that would be CPU efficient? Does anyone happen to know the formulae for VT and DP (don't care about SW: P because it refreshes with MF) or do I have to attempt to trawl through the Simulationcraft source code to find them?
Right now I have no idea if my ignorance of lua and coding in general will make this an impossible task but it's an interesting problem so I'm not willing to give up just yet. Wouldn't it be cool to be told automatically when overwriting a dot was better than flaying?