Probably documented somewhere, but I found it while digging through the battle routines so might as well.
0x8000E04 - grabs a random number (1-100 I think, but I’m not sure)
0x8000E84 - Responsible for the rng rolling for hit. You can clearly see it grabbing 2 random numbers and averaging them.