This is up to the DM, but it should work
The awakened spell book feature's second option says in full:
When you cast a wizard spell with a spell slot, you can temporarily replace its damage type with a type that appears in another spell in your spell book, which magically alters the spell's formula for this casting only. The latter spell must be of the same level as the spell slot you expend.
The feature is unfortunately not worded very well, leaving it for example unresolved, what happens if a spell deals multiple types of damage (or alternatively, as two damage types are not a damage type, the feature does not work at all, but there is less community buy-in for that idea).
The feature also does not say the change only applies to damage the altered spell deals. It changes the damage type of the spell. For example, you can change the damage type of Protection from Energy, which deals no damage at all but is a spell with damage types.
Elemental Bane is problematic in ways similar to spells that deal multiple types of damage, in not having a single, fixed damage type to replace. Instead, you are asked to choose a type in the description of the spell's effect. While the effects in the description only happen once the spell is cast, you make selections like its targets or here damage type, at the end of casting the spell. The fundamental question then is:
When in casting Elemental Bane can you replace "its damage type"?
During the casting the type has not yet been selected. Does such a spell not have a damage type to replace, and therefore this does not work at all (an unpopular view, but possible reading)? Does it mean you get to choose a damage type to replace, like advocated for multi-damage spells? Or can you wait until the end of casting, when a single damage type has been selected, and replace that? Like with spells that deal multiple damage types, this is not clear, and thus up to the DM.
What does formula mean?
The spellbook tells you you can change the spells formula to change the damage type. Formula is not a defined term here (there are formulas for creating magic items, but this is not one of those), and going back to the dictionary which we use for interpretation of such cases, there are two meanings that make sense here:
- a set form of words for use in a ceremony or ritual
- a recipie ("The product is made using a secret formula that the company refuses to reveal.")
The first one would mean you cannot change a spell if it has no verbal component (the words used), and since Awakened Spellbook has no such restriction, I think it is not a good choice.
The second one is the one that seems to fit best: the secret recipie describing how to manipluate the weave to call forth an effect. In my view, by using your awakened spellbook, during the casting you change that recipie, so it is as if there was another spell written down there, that listed another damge type in its text. While feature names are not rules text, this also fits with the idea with a spellbook that can change its contents, to alter the effects of spells temporarily.
Looking at the two options that let you use the Awakened Spellbook:
Replace during casting
Assuming you can replace one of the types, it would work like Magical Hack from Magic the Gathering: you are altering the formula or text of the spell, when you cast the spell, to replace a damage type with another. Here is the order of events:
- Cast Elemental Bane
- When casting, alter the formula text of the spell and replace one of the damage types with piercing damage (copied over from Faithful Hound).
- At the end of casting, pick the altered damage type, piercing that is now available to pick, and pick your target.
- All the effects now apply to piercing damage. If the target fails its save you get to deal an extra 1d6 piercing whenever you deal piercing.
To me, this is the reading is the one that is most faithful to the idea of changing the formula of the spell.
Replace once type has been chosen
I think it also would work if you select the damage type at the end.
- Cast Elemental Bane
- Choose Acid at the end as the spells damage type.
- Still at the end, apply Awakened Spellbook, and replace the spells damage type, acid, with piercing.
- If the target fails its save you get to deal an extra 1d6 piercing whenever you deal piercing.
Elemental Bane says:
choose one of the following damage types: acid, cold, fire, lightning, or thunder. The target must succeed on a Constitution saving throw or be affected by the spell for its duration. The first time each turn the affected target takes damage of the chosen type, the target takes an extra 2d6 damage of that type.
I do not see how the chosen type can differ from the final type. The spell says the damage is "of that type", so the extra damage therefore must be the same type as the chosen type. Dealing piercing on top of acid violates this. The only way to resolve this that the chosen type is the spells damage type, and is overwritten in the formula, so the chosen and dealt type become piercing (and match the extra damage).