The Los Angeles Dodgers and New York Yankees are cutting payroll and their luxury tax bills — just as Bryce Harper, Manny Machado and perhaps Clayton Kershaw near the free-agent market after the 2018 season.

The Dodgers are on track to slice their tax bill by about a quarter this year and the Yankees by two-thirds.

The San Francisco Giants also are set to slice their payment in the first season of baseball’s new collective bargaining agreement, but the Detroit Tigers are slated to pay more despite saying they want to reduce payroll.

If a team doesn’t pay tax in 2018, its tax rate would drop to 20 percent in 2019 — allowing perennially high-spending clubs to sign stars at a lower cost.

“What the market produces is what the market’s going to produce,” baseball Commissioner Rob Manfred said.

The Dodgers are forecast to pay a $25.1 million competitive balance tax this year, according to opening day calculations by the commissioner’s office obtained by The Associated Press, down from $43.6 million in 2015 and $31.8 million last year.

The Yankees’ bill is slated to be just under $9 million, their lowest since the tax began in 2003 and less than one-third of the $27.4 million they owed last season.

“The new CBA has had no influence on my belief that you don’t need a 200-plus million dollar payroll to win championships,” Yankees owner Hal Steinbrenner said in an e-mail to the AP.

The tax threshold increased from $189 million to $195 million under the new labor contract, and rates were simplified to three levels: 20 percent for first-time payers, 30 percent for those owing for a second straight season and 50 percent for clubs paying three times in a row or more.

A pair of surtaxes were added to discourage high rollers: 12 percent on the amount from $215 million to $235 million this year and a 42.5 percent and 45 percent above that, depending on how many consecutive years a team is paying.

Another change calls for a team more than $40 million above next year’s tax threshold of $197 million to have its top draft pick moved back 10 places — with an exception that if a club has a pick among the top six, that would be protected and its second pick would be moved back 10 slots.

The Yankees appear to be trying to get below the threshold in 2018 to reset their tax rate in anticipation of that fall’s free-agent class.

“I think it’s too early to make a judgment about the success of the new CBA,” Manfred said. “I also think that while there’s a lot of change in the CBT area in terms of the structure and rates and whatnot, there has been a certain cyclical nature to the CBA over time, irrespective of the change, right? Clubs get to a certain point, they step to go younger, they come down.”

The Dodgers have a major league-high $238 million payroll for purposes of the tax, which uses the average annual values of contracts for players on 40-man rosters and includes $13.96 million per team in benefit costs.

Actual tax is assessed on season-ending payrolls in December.

Los Angeles is projected to pay both new surtaxes. Under transition rules for 2017, the Dodgers’ projected tax is at the midpoint of what they would pay under the new rules ($25.58 million) and old ($24.68 million).

Dodgers President Stan Kasten declined comment on the team’s payroll and the tax.

With a projected payroll of $216.9 million, Detroit has a tax projected to be $6.8 million, an increase from $4 million. The Tigers pay at a 30 percent rate as an offender for the second straight season while the other teams over the threshold pay at 50 percent because they have been above for three or more consecutive years.

Tigers general manager Al Avila declined comment through club spokesman Craig Hughner.

The Yankees, at $212.9 million, are just under the surtax level. San Francisco is next at $199.6 million, leaving its tax set to decline to $2.3 million from $3.4 million. The Giants could have dropped below the tax threshold entirely, but decided to give reliever Mark Melancon a $62 million, four-year contract.

“The costs add up, as does revenue sharing,” Giants general manager Bobby Evans.

The Tigers, Yankees and Giants pay at the new calculation because they would have owed more under the old rules: $11.96 million for New York, $8.4 million for Detroit and $4.2 million for San Francisco.

Washington ($188.6 million), St. Louis ($186.5 million) and Boston ($183 million) have room to increase payroll without incurring a tax. The Red Sox would pay at a 50 percent rate after owing $4.5 million last year and $1.8 million in 2015. The others would pay at 20 percent because they have not been over the threshold.

Associated Press baseball writer Janie McCauley contributed to this report.