Hi Julien,
It may be worth pondering some alternatives before trying to modify
what is a moderatly complex plugin.
For example, you can threshold the underlay (instead of the overlay),
leaving the overlay free to be the drawn dataset as is done now. The
underlay threshold can be set by right-clicking on the underlay color
bar (just to the right of the underlay image), and applying "Choose
Display Range".
You still would have the ability to adjust the contrast and such, by
doing a left-button drag across the image.
Does that seem reasonable for your needs?
- rick