Thanks! I also needed to track time on each frame, so I ended up fixing it by adding the following to the mouse updates in the JS code:
const position = mouse_4.getPos();
mouse.x.push(position[0]);
mouse.y.push(position[1]);
mouse.time.push(mouse.mouseClock.getTime());