This is broken in 2 ways.
The character with the buff should lose this ability the next attack that happens.
This buff actually gives them 100% evasion for the next turn of attacks they are being hit with.
If you use an ability that calls an assist, or a double attacks happens to proc, the character will evade every single attack in that turn.
Easy example to reproduce
fight a team with yoda, wait till yoda has his foresight up
use an ability like qui gon or IG 86 or Fives or Biggs or Genosian soldier that guarentees an ally attacks as well.
Watch yoda foresight both attacks , 100% of the time.
If a character that has foresight is attacked and ACTUALLY dodges the attack on their own, without foresight, then foresight isnt lost.. this is kinda broken, they evaded it the attack, thats what foresight buff guarentees, that shouldnt have a roll at evading it anyways, and then 100% if their roll fails.. (cmon. :P just move foresight code check before the dodge check or it should probably be part of the guard statement)
easy example to reproduce
If you are fighting a team with a leader like dooku that gives high evasion, or luminara that has dodge up, and then yoda gives them foresight, you can manage to get it so your attack is dodged but they still keep foresight because they would have dodged it naturally if foresight wasnt already there.