I modified it to this but I have noticed that a lot of times it restarts even though the speed is over 1mb.
Code:
//check if downloads are running at all
if (isDownloadControllerRunning() && !isDownloadControllerStopping()) {
var running = getRunningDownloadLinks();
//loop through all running Downloads
for (var i = 0; i < running.length; i++) {
if (running[i].getDownloadDuration() > 20000) {
if (getTotalSpeed() < (1000 * 1024)) {
stopDownloads();
do {}
while (!isDownloadControllerIdle());
startDownloads();
}
}
}
}