change avrdude # of programming attempts?

I'm working with a number of chips that could be in faulty circuits and many times the AVRDUDE programmer fails when using AVRISP MKII programmer option from the current Arduino IDE. It takes almost 2 minutes to complete the max programming attempts which is 10 :

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x20

This is a huge hindrance when I am troubleshooting, it takes forever. Is there a way to change the number of programming attempts or the length of time it spends trying to program the chip? I'm looking for like 1-2 seconds. Thanks.

I've done some searching for a solution to this, but didn't find anything other than modifying the source code. It's really ridiculous how long the delay is between attempts. If it doesn't work in the first 10 seconds, it's never going to work!

This is one thing I'm really enjoying about using Arduino CLI more often; you can just hit Ctrl + C, kill that stupid process, and move on.

Sure, you can pull the USB cable to force it to fail immediately, but I prefer to be able to do it from software, especially since I'm often uploading to a board I don't have easy physical access to.

There's a related feature request and some discussion here:

and more avrdude-specific discussion here: