Yes, you are correct: "If it weren't for your timely help, Thomas wouldn't have done so well in the test." Both the help given, and the test, are in the past, so: "If it hadn't been for your timely help, Thomas wouldn't have done so well in the test."