DEREK Mackay’s schoolboy error may just be the straw that broke the camel’s back for the SNP.

The party, which has weathered many a severe storm before now, has had a disastrous week which will take nothing short of a miracle to recover from. Along with the budget being largely ignored by the public, despite junior minister Kate Forbes’ sterling delivery and performance in the chamber, allegations that the Scottish Government tried to prohibit publication of a story about the finance minister’s inappropriate messages have done nothing to help its reputation.

It seems the party has been left in turmoil by the latest scandal which saw Mackay, the high-flying finance minister tipped as a replacement for Nicola Sturgeon, resign from his senior role in disgrace.

READ MORE:  Teenager at centre of Derek Mackay scandal speaks to police

What caused the former minister to quit was not just the fact he had contacted a 16-year-old and showered him with compliments about his looks, and invited him to dinner and a rugby game. This young man had no previous connection, it seems, to the 42-year-old father of two, was not gay and was not reciprocal to Mackay’s obvious advances. In fact, the boy repeatedly seemed to ignore many of the 260 messages he received over six months.

The comparison between Mackay’s communications and grooming patterns shown by online predators is uncomfortable, not least for his party colleagues who considered him an asset to the SNP, a friend, a reliable colleague and a safe pair of hands. Dig deeper into Mackay’s behaviour however, and it is not hard to find party members, many of whom are young male activists, willing to share a story or two about their own experiences of the shamed minister. His night-time messaging habits were widely known about predominantly by gay members of the party.

While he was enthusiastic about his role in the Scottish Government, Mackay was equally enthusiastic, it is claimed, about clubbing and partying. Nicola Sturgeon was said to have advised him not to drink at party conferences following concerns raised about his behaviour at "conference karaoke" – a social event attended by many younger party members.

The effects of the Mackay scandal are manifold, and may not be fully realised until the next elections for Holyrood in 2021. His is just the latest catastrophe to hit the SNP, though, and the cumulative effects of all these problems together may now be creating a chink in the party’s armour.

At the peak of its popularity, around the time of the independence referendum in 2014 and its immediate aftermath, the SNP was seen as a party which could do no wrong, a force for a progressive Scotland and a better future for the next generation.

Members appeared to consider themselves morally superior to those in other parties, and it is this superiority which may lead to its downfall. Now the mask appears to be slipping, and the 12-year-long honeymoon period could be coming to an end for the nationalists.

While there is no doubt the party, led by Alex Salmond and then Nicola Sturgeon, has presided over some important and welcome changes in Scotland, the evidence of problems is hard to ignore. Time and again during the general election campaign opposition politicians from both the Conservatives and Labour brought up the SNP’s track record on health and education, using it as a stick to beat their Westminster candidates during interviews and debates.

Unless there is a spectacular improvement in, for example, hospital and mental health waiting times, school attainment or drugs deaths, these problems will continue to plague the party over the next 18 months.

The scandal of the £842m Queen Elizabeth University Hospital and Royal Hospital for Children in Glasgow, combined with the problems facing Edinburgh’s new Sick Kids facility, has rocked the country and the party too. Health minister Jeane Freeman has desperately tried to turn public opinion around. After daily calls for action, she eventually agreed to a judge-led public inquiry into the problems, as well as raising NHS Greater Glasgow and Clyde to level four scrutiny.

The Herald:

READ MORE: Nicola Sturgeon 'banned shamed Derek Mackay from drinking at SNP conferences' 

Independent advisers and experts have been drafted in to oversee various elements of the health board’s operations, and a dedicated liaison has been appointed to aide communication between patients, their families and NHSGGC.

However, looking at the bigger picture, almost half of the country’s health boards are now under varying levels of external scrutiny, waiting times are through the roof and nobody will forget the punishing drugs death figures released last year showing Scotland to have the worst rate in Europe.

On top of this, the slow-moving ferries contract scandal – the latest episode of which is revealed in this newspaper today – is now gathering pace with more information emerging about its woeful mishandling every week.

Renowned businessman Jim McColl made a series of startling revelations during a committee at Holyrood where he alleges outright mismanagement of the £200m contracts. Such an expensive purchase, now years overdue and with completion nowhere in sight, adds to the growing doubt about the SNP’s ability to lead the country and manage high-profile projects.

The whole fiasco not only casts doubt on the competence of the SNP as leaders of the Scottish Government, but the competence of Holyrood as a whole. As many frustrated MSPs have suggested, the SNP’s poor record on these highly important projects risks throwing Scottish politics into disrepute.

The future for the SNP cannot be discussed without mentioning the Alex Salmond trial, which is due to start next month. While the former First Minister denies all the allegations against him, which include attempted rape and multiple counts of sexual assault, the case is certain to shine a light on a party which until recently seemed untouchable.

Finally the gender recognition act reforms, pledged in the party’s manifesto, have been delayed after concerns were raised about the impact on women’s rights and safety. While legitimate concerns must be heard and debated fully, the discussions surrounding the issue have fractured the party in ways never seen before.

Senior figures have openly slated their colleagues, blocked them on social media or threatened to sue if they dare question their motives for opposing the reforms. It is a scenario which, five years ago, would have been unimaginable for the indestructible party.

READ MORE: Joanna Cherry condemns 'grooming behaviour' in wake of Derek Mackay scandal 

While Derek Mackay’s “foolish” behaviour may not have caused major ripples within the SNP if taken in isolation, its timing could not have been worse and the cumulative effects are yet to be seen.

What is certain, however, is that the party is in for a bumpy ride and it may take nothing short of a miracle to prevent the SNP suffering lasting damage this time.