1-have you lost any fluid ?

2-you say the master cylinder was replaced with a used part, it could be bad as well.

3-you said the problem went away for a while when the ( used ) master cylinder was installed.

If you haven't lost any fluid its most likely a bad master cylinder...
__________________