The European Union (EU) could slash funding for governments that fail to uphold democracy after it announced plans Wednesday to link its budget with the political health of member states.

The EU said that it wants to link future budgets to whether or not member states have an effective judicial system in place, such as independent courts. Funds could be suspended or restricted if EU countries fail to cooperate with anti-fraud investigations and undermine independent media organizations.

Current EU rules do require member states to demonstrate that they are robust against fraud, but the European Commission (EC) said that there was no current mechanism in place to protect EU taxpayers' money "in case of deficiencies regarding the rule of law in a member state."

"Only an independent judiciary that upholds the rule of law and legal certainty in all member states can ultimately guarantee that money from the EU budget is sufficiently protected" the EC said in a statement.

New measures, which must first be agreed by EU member states, could hit Hungary and Poland — two of the biggest recipients of EU funding.

Poland's government has been criticized for passing laws that weaken judicial checks and balances, while Hungary's Prime Minister Viktor Orban has been accused of a crackdown on the country's free press.

Hungary's Foreign Minister Peter Szijjarto warned Wednesday that he would not yield to "blackmail," according to Reuters.

"We do not agree with any proposal that would provide the potential for blackmail of anyone with regard to the payment of EU funds that are due to be given to countries based on the treaties," he said.