Shares of Hershey Co. (HSY) - Get Report have been on a downward trajectory in recent months - and they dropped further after a UBS analyst downgraded the maker of the iconic Hershey's Kiss on Tuesday.

Continued poor performance coupled with the company's high-profile 2016 rejection of a $23 billion hostile cash and stock bid from Mondelez International Inc. (MDLZ) - Get Report  would normally combine to make Hershey an attractive candidate for an activist hedge fund looking to potentially push the company to auction itself, with the support of frustrated rank-and-file shareholders.

However, an activist investor would have a tough if not impossible time targeting Hershey for a sale since the Milton Hershey School Trust, set up by founder Milton Hershey, controls all super-voting Class B shares and 80.9% of the voting power, according to the Investor Responsibility Research Center Institute. That structure puts the trust firmly in control of the chocolate and snack maker's board.

"We don't view them as a likely takeover target or an opportunity for an activist investor to shake things up because the ownership structure gives the trust outsized voting control," said Erin Lash, an analyst at Morningstar Research Services LLC.

However, there is an opening for an activist to exert some influence at the company. According to Hershey's most recent proxy statement, two directors on the company's 13-person board are elected by outside class A shares. The Trust only controls 5.6% of these common shares. As a result, an activist could win a director fight to install two directors, but they would only be a small minority on the company's board and would likely not have much power to drive change.

And if the activists wanted Hershey to consider selling itself, a typical tactic employed by insurgent managers, they would run into other significant bipartisan roadblocks as well. Consider that Pennsylvania's attorney general appears to have some serious influence in blocking a deal.

At the time of the Mondelez bid, Pennsylvania state senator John Rafferty, the Republican candidate for attorney general, reportedly said he had "serious reservations" about a potential sale to Mondelez. The Democratic candidate, Josh Shapiro, also reportedly said at the time that he would "vigorously protect Hershey's continued success in Pennsylvania" and defend it from "Wall Street investors."

Michelle Buck, Hershey's CEO

Shapiro, currently Pennsylvania's attorney general, would probably not look to kindly to an activist seeking to drive a sale of Hershey.

"It would be very hard for a deal to get done or for anyone to come in and try to restructure the company to any extent," said Lash. "Not only does the school trust need to approve deals but the attorney general of Pennsylvania is involved as well." 

Nevertheless, Hershey's shares tumbled 3.5% to $95.86 a share on Tuesday after UBS slashed its rating to sell with a price target of $90 a share. UBS analyst Steven Strycula didn't pull any punches in his brutal downgrade. He thinks Hershey is overexposed to slowing demand for chocolate and intensifying competition from rivals Mars and Mondelez. Cocoa's 29% price surge this year also doesn't help Hershey, says Strycula.

Lash however has a fair value price target of $118 a share, adding that she believes the company's strategy, offered up by CEO Michele Buck, laid out when she took over as CEO in March 2017, makes a lot of sense. "They are focusing resources on their core North American operations and pulling back in international markets where we think they are disadvantaged," Lash said. "Some of the things they are doing make a lot of strategic sense."

-Brian Sozzi contributed to this report