Trying to check for difference in variables in Conditional Branch

I'm trying to figure out how to check for the difference in two variables.
I attempted it with this script call:

$gameVariables.value(13) - $gameVariables.value(12) = -20

Which didn't work and crashed the game. I basically want it to branch off if variable 13 - variable 12 equals -20.
For example if variable 13 is 40 and variable 12 is 60 it's supposed to notice that they're 20 apart.
$gameVariables.value(13) - $gameVariables.value(12) = -20
if($gameVariables.value(13) - $gameVariables.value(12) == -20)
u could do it with rpg maker normal commands using a third variable c
  • Change variable C: set a
  • Change variable C: sub b
  • Conditional branch: C is…
Or what aqua said with scripts.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-check-for-difference-in-variables-in-conditional-branch.159295/