It's applying perception in the following turn.
i've got 200 perception, i lost 100 perception and gain 100 from shadow trap, ok it seems i have 200 perception, but it doesn't work so
because it look at your perception as a buff to normal perception.
at the start of your next run it will read 100 perception first, and then add those 100 you gained from Shadow trap. but reading only 100 perception first makes you visible, and that's a bug because you have 200 perception.
that 100 perception it read is from the previous turn buffs.
Please fix it