For the purposes of the resistance/immunity example in the original question:
"bludgeoning, piercing, and slashing from nonmagical weapons that aren't silvered"
The "weapons" portion of the example is actually sufficient to know that it does not apply against the example sources of damage, magical or not. The resistance only applies to specific damage type subcategories of weapon damage. None of the given examples are weapon attacks, so this resistance/immunity to damage from weapons does not apply to the given non-weapon examples in the question regardless of what type of damage is being done.
That said, errata has updated most (all?) instances of the given resistance/immunity example in the question to the following:
Bludgeoning, Piercing, and Slashing from Nonmagical Attacks that aren't Silvered
(Weapons -> Attacks)
Now it's clearer that the magical status of the attack itself should be considered.
The Sage Advice compendium provides the following checklist for determining if something is considered magical (see also: How do I know if an ability is magical?)
If you cast
antimagic field, don armor of invulnerability, or use another
feature of the game that protects against magical or nonmagical
effects, you might ask yourself, “Will this protect
me against a dragon’s breath?”
[...]
Determining whether a game feature is
magical is straightforward. Ask yourself these questions
about the feature:
- Is it a magic item?
- Is it a spell? Or does it let you create the effects of a spell
that’s mentioned in its description?
- Is it a spell attack?
- Is it fueled by the use of spell slots?
- Does its description say it’s magical?
Since the question's examples are all spells or spell attacks, they fall cleanly under the umbrella of being magical. As such, thorn whip and the initial spell attack of ice knife are considered magical attacks, which clearly bypasses the errataed resistance/immunity text. Damage dealt as an effect of spell that isn't related to a spell attack roll (like the damage of earth tremor) is both magical and not from an attack, so the resistance/immunity text also doesn't apply there.
It's also worth noting that there's currently no such thing as an attack that is both a spell attack and a weapon attack, as noted in answers to a question about how to refer to non-spell attacks.
PHB p.197
Resistance and then vulnerability are applied after all other modifiers to damage. For example, a creature has resistance to bludgeoning damage and is hit by an attack that deals 25 bludgeoning damage. The creature is also within a magical aura that reduces all damage by 5. The 25 damage is first reduced by 5 and then halved, so the creature takes 10 damage.
You take off the damage reduction and then halve the damage. Option 1 in your question.
Best Answer
Skeletons are vulnerable to Bludgeoning damage and some oozes have abilities triggered by slashing.
A magic sword still does slashing damage as well, it is just magical allowing it to hurt something like a golem.
And specific to the original query on piercing damage, took me a while to find it but Rakshasa: