I'd say not very easily - you could replicate the unit you want (I think the gamecache Store Unit function can create an exact copy with items/abilities intact) and order it to attack a pre-placed magic immune target dummy (one for each player) - then, when <dummy> takes damage, and BooleanVar[Player number] = false, start a timer and set BooleanVar to true.
When the dummy takes damage again (check if BooleanVar[Player number] is true), set a real variable to GetElapsedTime (YourTimerVar), remove the replicated unit, set BooleanVar[Player number] to false again, and display the value of the real variable to the player.
Also, make sure that you can't activate the trigger more than once every X seconds, so people can't create a second testing unit, which would obviously screw up your results (easiest way would probably be to check if BooleanVar[Player number of Triggering Player <assuming you're using a chat command, or Escape key>] is true or false - if true, don't do the test (since it's already running), else do the test)
Reddit, Slack, Google, Facebook, Instagram — these companies use our data — directly or indirectly — to train the next generation of AI language models. Yet, I don’t remember anyone asking our permission, and in doing so, these companies have proven the adage that customers’ data is their main...
Our new website went up early yesterday. Health Empowers You. 200 smoothie recipe guide and soon we will have detox, cognitive enhancement, weightloss teas and some coffee blends. https://healthempowersyou.net/products/smoothie-recipe-guide
It never fails that as soon as I say something about the bots they come back - this time they are under a whole new IP range - one thing in common though, Chinese!