Hopefully, you can find the widget in the marketplace having a GitHub repo linked to it. I would say the best way to adapt it is to fork it, and make your changes in your own repo. For small changes, do a pull request to merge your proposed change into the original widget. For large changes, expose your own widget in the marketplace (assuming this is allowed by licenses).
Sometimes, you only can do it the way you describe, which is not that bad, I would say.