It may not have everything you want, but this does have layers with toggable visibility for freehand pencil/paint:
https://woodring.itch.io/patternshop
It used to have different compositing operators, other than underpaint. But, I figured the 99% use case was underpaint compositing, so I dropped the rest.