For nearly a month, Harry Cook had been looking nervously over his shoulder.

Cook, the Washington lobbyist for an association of water freight companies, knew that S.790, the waterway user charge bill, was coming up this week for a final Senate vote. And Harry Cook knew, he just knew, that Pete Domenici would try to pull a fast one before the vote.

Over the past 18 months Cook had been battling Sen. Domenici (R-N.M.) over Domenici's user charge bill, which would force water shippers to pay the government for their use of federally maintained inland waterways.

Without adroit parliamentary strategy and help from the White House, Domenici had won the first round last June, when the Senate approved a tough waterway fee. But Cook and his allies recouped somewhat last fall, when the House passed a much weaker version of the bill. Now the issue was back in the Senate.

All this spring Domenici and Sen. Russell Long (D-La.), the waterway bill's chief opponent in the Senate, had carried on extended negotiations in an effort to find a compromise. But they could not overcome one basic difference.

Domenici wanted the waterway fee to be linked to the government's annual expenditure on water projects: the more federal money spent, the higher the barge fee. Such a link, he figured, might limit the barge industry's appetite for expensive new water projects.

But Long and his allies in the barge industry adamantly opposed that linkage.

When it became clear that Long and Domenici could not agree, they told Majority Leader Robert C. Byrd (D-W. Va.) that he might as well bring the bill up on the floor for a final confrontation. Byrd scheduled the debate for this week.

That was when Harry Cook got worried.

In a "confidential memorandum" to his association's members, Cook warned that "Sen. Domenici might pull some last-minute voting ploy. . . Admittedly, he is crafty and resourceful. And he won last June"

How right Cook was Within days after that confidential memo was mailed, the senator from New Mexico was indeed developing a resourceful new stretegy. If he couldn't compromise with Russell Long, Domenici would find somebody else to deal with.

At the suggestion of Transportation Secretary Brock Adams, who has supported the waterway fee all along, Domenici made an overture to Sen. Adlai Stevenson (D-Ill.). Stevenson had sided with the barge industry when S.790 came up last June, but he had also indicated that he saw some merit in Domenici's proposal.

With remarkable ease, the two reached an agreement, and they held a press conference yesterday to announce it.

Domenici would accede to Senate aothorization of $430 million for a major new barge facility in Alton, Ill. -- a project dear to the hearts of Sen. Stevenson and bargemen everywhere. In return. Stevenson would agree to a waterway fee, including a provision linking the fee to federal spending on water projects.

What's more, the two senators announced yesterday, their agreement had teeth. With the help of Brock Adams, they had won explicit support for their compromise from Jimmy Carter. In fact, the president said he would veto any waterway bill that didn't include the basic components of the Domenici-Stevenson package.

It was a threat to be reckoned with. The waterway bill before the Senate includes far more than the user charge; it also contains the athorization for the Alton barge project, and for another billion dollars worth of water projects in 34 states.

In short, a large number of senators, however they may have felt before, now have good reason to support the Domenici bill.

Harry Cook had seen it coming, but that didn't make the ploy any easier to take. "I don't know what we'll do now," he said sadly last night. "We've got two days until the vote, and I don't know what we'll do."