Viet doesn't say how to "convert (keystore + password) -> private key programmatically", but it seems to be possible with Node.js with the function keythereum.recover(..):
const fs = require("fs");
const keythereum = require("keythereum");
const KEYSTORE_DIR = "The full path of your keystore ...
You might try popping this in the geth console, tweaking the block production rate for your chain of interest:
const secPerSample = 10;
const sampleWindow = 100;
const networkBlocksPerSec = 1 / 2.3; // network block time (polygon makes a block every ~2 seconds)
const dataPoints = ;
var topBlock = eth.syncing....