I'm willing to admit defeat and accept the popular answer
here, but I'm not convinced that changing targets doesn't trigger "when attacked" on the new target. I've added a comment to this effect but am wondering if I can get sources on this from y'all here.