Yahweh became the only god who should be worshipped, according the religious leaders in Judah, but it seems they were still Henotheists more than real Monotheists IMO.
Monotheism in the sense of claiming that pagan gods were not real was a late development.
But it is clear that the Trinity Doctrine was not something made out of whole cloth, it was a natural evolution from the ideas of what the Divinity of Christ consisted of.
Of course, the Scriptures used to justify it could easily be culled from the polytheistic influenced ones of the O.T, as well as the Gospel of John.