Interesting... I've never heard of this and none of our lawyers in frivolous lawsuits have brought it up. (Although none of the cases have gone to trial...)
It would only apply in federal court, there are nuances surrounding the fact that the offer must have been unilaterally better than the actual judgement (i.e. if the offer came with an NDA attached, the judgement probably wouldn't). Here's a great video going over a case where this happened. https://www.youtube.com/watch?v=KSs5bQGxpas