Green’s Dictionary of Slang

not worth a damn phr.

also ...a continental damn, ...a dam, ...a darn, ...a drat
[damn n.]

[mid-19C+] a negative phr. used to imply uselessness or incompetence; thus occas. antonym worth a damn, valuable, worthwhile; see also under worth a... phr.