Just to add a bit more, did some looking into how address $00009c works:
80b903 jsl $bc904b [bc904b] A:0000 X:0001 Y:0004 S:013f D:0000 DB:81 nvMXdiZc V: 17 H:1170
bc904b rep #$20 A:0000 X:0001 Y:0004 S:013c D:0000 DB:81 nvMXdiZc V: 17 H:1224
bc904d lda $009c [81009c] A:0000 X:0001 Y:0004 S:013c D:0000 DB:81 nvmXdiZc V: 17 H:1242
bc9050 asl a A:5160 X:0001 Y:0004 S:013c D:0000 DB:81 nvmXdizc V: 17 H:1276
bc9051 clc A:a2c0 X:0001 Y:0004 S:013c D:0000 DB:81 NvmXdizc V: 17 H:1288
bc9052 adc $009c [81009c] A:a2c0 X:0001 Y:0004 S:013c D:0000 DB:81 NvmXdizc V: 17 H:1300
bc9055 xba A:f420 X:0001 Y:0004 S:013c D:0000 DB:81 NvmXdizc V: 17 H:1334
bc9056 sep #$20 A:20f4 X:0001 Y:0004 S:013c D:0000 DB:81 NvmXdizc V: 17 H:1352
bc9058 sta $009d [81009d] A:20f4 X:0001 Y:0004 S:013c D:0000 DB:81 NvMXdizc V: 18 H: 6
bc905b clc A:20f4 X:0001 Y:0004 S:013c D:0000 DB:81 NvMXdizc V: 18 H: 32
bc905c adc $009c [81009c] A:20f4 X:0001 Y:0004 S:013c D:0000 DB:81 NvMXdizc V: 18 H: 44
bc905f sta $009c [81009c] A:2054 X:0001 Y:0004 S:013c D:0000 DB:81 nvMXdizC V: 18 H: 70
bc9062 rtl A:2054 X:0001 Y:0004 S:013c D:0000 DB:81 nvMXdizC V: 18 H: 96
So it takes the full previous value and multiplies it by 3, writes the hi byte to $009D, then adds $009C to that hi byte and stores the result in $009C.
What's interesting about this is, unlike in Dragon View where it uses the H/V Scanline Counters after reading controller input to generate something pseudo-random that changes with controller input, this should be a totally deterministic sequence independent of everything you do. In other words, unless something manually resets it, the only way you can influence the RNG is changing when the decision is made. ie/ a boss fight should go the exact same way every single time, so long as you start it on the same frame (and the RNG began rolling on the same frame) (unless you can change when they make a decision by hitting them at a different time or something).
Upon thinking about it some more, it's entirely possible the AI's decision-making could be based on both RNG and something like your position as well. But at least you know where the random element comes from.
It seems to be initialzed with value $0D37 and starts running on frame 694 in your file, though it pauses during the lag frames / loading time.