
SlimGauge |

I'm not certain you get to see the result of the attack before spending your immediate action to activate an already-cast Hostile Juxtaposition.
The trigger is "When attacked or the subject of a spell that deals damage to you". Not "when HIT or DAMAGED by an attack or a spell"
I don't think you can wait to see how much damage that magic missile or fireball did or if that crossbow bolt hit before choosing to activate the spell. All you get is "you're being attacked by <whatever>".
The spell says "The target then becomes the target of the triggering attack or spell instead of you." So yes, you'd use the new target touch AC.
I do note that by a strict reading, you don't get to HJ away from spells that don't do damage and aren't considered "attacks" ...