Creating a new audio plugin which shares code with an existing plugin

The easiest way is to put the shared code in a JUCE module.

Check this thread to get started: Creating user modules tutorial?