The Master of Ostrheinsburg and non specific vitality gain

By Imomon, in UFS Rules Q & A

The master of ostrheinsberg reads:

R Destroy this foundation: Before your opponent gains vitality due to their card effect, they lose X vitality instead of gaining vitality. X equals the amount of vitality they would have gained due to their card effect.

Battle Prowess reads:

E Commit: Gain X vitality. X equals the difficulty of any attack in your opponent's discard pile. Only playable during your opponent's turn.

If I use battle prowess and my opponent responds with the master of ostrheinberg do I choose the value of X before or after my opponent decides if they want to respond. That is could I choose the lowest possible value since I know that I will be losing vitality or do I choose first and then my opponent decides to respond or not? Sorry if this has been answered already but when I did a search I ended up with a ton of threads/posts about path of the master.

Thanks

Imomon

You choose X before

Master of Ostrheinsburg responds when the vitality gain would be happening, so X is determined before MoO responds. (moooooooooo)