Is there something like the Madrid system for trademarks but for patents that gives you international protection for it by registering in one place?
The short answer is there is no equivalent for patents for the Madrid system for trade marks.
The closest thing is the PCT (Patent Cooperation Treaty) that covers most of the world:
It buys the applicant more time (30 months from the earliest application) to settle their patent application and choose the countries that they want to proceed in (the PCT National Phase and PCT Regional Phase Entry systems) before actually filing the patent application in those territories. The Paris Convention, in contrast, only allows 12 months:
The PCT system works out costing more if you have only a few territories of interest but starts to make more sense the more territories you want to gain protection in. Ultimately, a PCT application has to become a national application in each country of interest to you.